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)

Submitted by:  None
Submitted on:  Fri 12 May 2006 05:59:14 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Duplicate
Privacy: PublicAssigned 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

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 17 May 2006 08:59:12 PM UTCjulianfoadStatusNone=>Duplicate
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1