This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with Bash regex test case sensitivity


On 12/3/10, Eric Blake <eblake@ > wrote:
> On 12/03/2010 07:11 PM, Lee wrote:
>>> Or, is this a bug?
>
> No, but a "feature" of your locale.  Set 'export LC_COLLATE=C', and use
> LANG rather than LC_ALL for all your other locale defaults, in your
> ~/.bashrc if you don't like it.

Nice tip - thank you.  But is there a reason I'd want LANG set to
en_US.UTF-8 instead of C.UTF-8?  As far as I can tell, everything
works for me with LANG=C.UTF-8.  Other than changing the collating
sequence to something I don't want, what does LANG=en_US.UTF-8 get me
that LANG=C.UTF-8 doesn't?

& as long as I'm showing how ignorant I am...  why put the local
defaults in ~/.bashrc?  My understanding is that ~/.bashrc is called
at every shell startup.  Seems like that's one of those things that
just needs to be set in the login shell, so wouldn't ~/.bash_profile
be more appropriate for the locale settings?

>> Welcome to the new world order :-0   I tried to figure out why the
>> collating sequence changes with the language settings but didn't get
>> anywhere beyond the fact that it _does_ change.  Oh well.. try, try
>> again.
>
> 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.

Regards,
Lee

--
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]