Bug 828844 - grep -i (case-insensitive) is broken with UTF8
Summary: grep -i (case-insensitive) is broken with UTF8
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: grep
Version: rawhide
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-05 12:55 UTC by Jaroslav Škarvada
Modified: 2012-07-14 21:50 UTC (History)
3 users (show)

Fixed In Version:
Clone Of: 826997
Environment:
Last Closed: 2012-07-14 21:50:37 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jaroslav Škarvada 2012-06-05 12:55:52 UTC
+++ This bug was initially created as a clone of Bug #826997 +++

I reported this bug in the grep bug tracker, but since this is an important bug, I'm submitting it here, so it might get patched in RHEL6.

Since version 2.6.1 grep doesn't work correctly if you use a case-insesitive search with UTF8 encoding when there is an UTF8 character. Here is the example:

# Without -i switch everything works correctly
$ echo -e 'AA UTF8 char İ 12345\nAA 12345' | grep 'AA'
AA UTF8 char İ 12345
AA 12345

# With -i it breaks
$ echo -e 'AA UTF8 char İ 12345\nAA 12345' | grep -i 'AA'
AA UTF8 char İ 12345AA 12345

As you can see it somehow deletes the new line character in the line which has an UTF8 'İ' character.

Everything works correctly in versions 2.5.4 and below, it's broken from 2.6.1 to the latest version (which is atm 2.6.12) and of course it's broken in the grep-2.6.3-2.el6.x86_64.

This is a big concern, since it will break scripts which filtere UTF8 input using -i switch.

--- Additional comment from jskarvad on 2012-06-05 14:45:10 CEST ---

Thanks for reporting, clonning to Fedora.

Comment 1 Fedora Update System 2012-07-10 09:38:32 UTC
grep-2.13-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/grep-2.13-1.fc17

Comment 2 Fedora Update System 2012-07-10 20:56:22 UTC
Package grep-2.13-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grep-2.13-1.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-10484/grep-2.13-1.fc17
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2012-07-14 21:50:37 UTC
grep-2.13-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.