bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep locale off by one?


From: P
Subject: Re: grep locale off by one?
Date: Thu, 21 Aug 2003 10:42:55 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701

address@hidden wrote:
What in the name of holy collating orders
is going on below?

$ echo "Z" | grep "[a-z]"
$ echo "Y" | grep "[a-z]"
Y
$ echo "a" | grep "[A-Z]"
$ echo "b" | grep "[A-Z]"
b

I know LC_ALL=C "fixes it", and I understand the collating
order being case insensitive, but why the inconsistency,
on the first and last characters (a and Z
in this case). Is it an off by one? Version info follows.

$ rpm -q grep glibc pcre
grep-2.5.1-7
glibc-2.3.2-11.9
pcre-3.9-10

$ echo $LANG
en_IE.UTF-8

Looks like it's UTF-8 specific.
Removing this makes it behave consistently.

$ echo "Y" | LANG=en_IE.UTF-8 grep "[a-z]"
Y
$ echo "Z" | LANG=en_IE.UTF-8 grep "[a-z]"
$ echo "Y" | LANG=en_IE grep "[a-z]"
$ echo "Z" | LANG=en_IE grep "[a-z]"

Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]