buggrep - Bugs: bug #16567, -i and character classes `[ab]' in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #16567: -i and character classes `[ab]' in multibyte locale (utf8)

Submitter:  None
Submitted:  Fri 12 May 2006 05:59:14 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Duplicate
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Wed 17 May 2006 08:59:12 PM UTC, comment #2: 

Thanks for the report, Sebastian.  Yes, it's already fixed.  I am closing this, calling it a "duplicate" of patch #3800, although that wasn't exactly a bug report so it's unsurprising that you didn't find it.

Julian Foad <julianfoad>
Mon 15 May 2006 09:03:39 PM UTC, comment #1: 

This has apparently been fixed in CVS:

$ echo Elk | LC_ALL=en_US.utf8 src/grep -i '[eo]lk'
Elk
$ echo Elk | LC_ALL=en_US.utf8 src/grep -i '[EeOo]lk'
Elk

Benno Schulenberg <bens>
Fri 12 May 2006 05:59:14 AM UTC, original submission:  

`[ab]' and `(a|b)' in combination with option `-i' should be equivalent, I guess. They aren't in multibyte locales (utf8).

In addition `-i' prohibits a match when `[AaBb]' is searched.

The error doesn't occur when the text is downcase and the pattern uppercase.

[volga:~] echo Elk | LC_ALL=C grep -i '[eo]lk'
Elk
[volga:~] echo Elk | LC_ALL=en_US grep -i '[eo]lk'
Elk
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep -i '[eo]lk'
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep -i '\(e\|o\)lk'
Elk
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep -i '[EeOo]lk'
[volga:~] echo Elk | LC_ALL=en_US.utf8 grep '[EeOo]lk'
Elk
[volga:~] echo elk | LC_ALL=en_US.utf8 grep -i '[EO]lk'
elk
[volga:~] grep -V
grep (GNU grep) 2.5.1
[volga:~] uname -a
Linux volga 2.6.13-15.8-default #1 Tue Feb 7 11:07:24 UTC 2006 i686 i686 i386 GNU/Linux


In the manpage I found:

Many locales sort characters  in  dictionary  order,  and  in  these  locales
[a-d] is typically not equivalent to [abcd]; it might be equivalent to [aBbCcDd], for example.


sebastian nagel (wastl[]cis.uni-muenchen.de)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-05-17 julianfoad StatusNone Duplicate
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code