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: grep problem?


http://cygwin.com/acronyms/#PPIOSPE - redirecting to the list

On 04/05/2011 10:20 AM, Jim Garrison wrote:

>> POSIX states that range expressions (such as [A-Z]) are undefined in
>> any
>> locale except C; and some locales (like en_US.UTF-8) happen to treat A-
>> B
>> as AaB, A-b as AaBb, and so forth (that is, they collate
>> case-insensitively).
>>
> 
> Interesting.  I assumed it had to do with collation, but curiously, on Fedora 10 I get different results:

Not all en_US.UTF-8 locale implementations are created equal.  Some
implementations of that locale have taken additional measures to make
collation vs. range computation try to behave saner.

> I'm confused.  Is Fedora 10 wrong?

Not necessarily wrong, just different.

Which is why POSIX states that outside of the C locale, range
expressions are non-portable.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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