X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Sat, 4 Dec 2010 16:06:42 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Problem with Bash regex test case sensitivity
Message-ID: <20101204150642.GA26471@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4CF96F70.3090507@veritech.com> <AANLkTikQJEJ6kHKZdzzA_YB_DHgZBevCLDKtAEm6ZgBg@mail.gmail.com> <4CF9BA08.8060703@redhat.com> <AANLkTi=pSXnqvF5OsQbaP8nE6sGHsL6crOG3z9D6SzWs@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <AANLkTi=pSXnqvF5OsQbaP8nE6sGHsL6crOG3z9D6SzWs@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Dec  4 10:05, Lee wrote:
> On 12/3/10, Eric Blake <eblake@ > wrote:
> > Read the FAQ.  http://www.faqs.org/faqs/unix-faq/shell/bash/, E9.
> 
> Which says the en_US locale collates the upper and lower case letters like this:
> 	AaBb...Zz
> 
> I got that much :)  What I don't get is why someone would _want_ the
> collating sequence to be AaBb... or why that sequence was picked for
> en_US instead of using the natural order of A-Za-z.

It's not the "natural" order, it's an arbitrary order which has been
chosen back in 1963 when the ASCII code has been defined.  It's not used
as "natural" order outside of computer systems and it's not even the
natural order on some computer systems (See EBCDIC).

If you take a look into a hardcopy encyclopedia written in english,
you'll be very comfortable that the words are ordered lexicographically
instead of in ASCII coding, probably.  Needless to say that ordering
criteria for non-english languages may contain more characters in the
sequence, in german for instance

  "AaäBb...Ooö...Ssß...Uuü...Zz"

So, let's reiterate:

- If I need the order for the computer language, I say so:

   LC_COLLATE=C.UTF-8

- Otherwise, if I need the order for the natural language, I say so:

   LC_COLLATE=en_US.UTF-8
   LC_COLLATE=de_DE.UTF-8
   ...


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

