URL:
<http://savannah.gnu.org/patch/?6869>
Summary: fgrep/egrep returns wrong matched none UTF-8 chars
Project: grep
Submitted by: fujiwara
Submitted on: 2009年07月17日 08時20分26秒
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
fgrep/egrep check ASCII chars so the command doesn't work on none UTF-8
locales.
E.g. in GB18030 encoding, 4 bytes 0x 81308938 expresses a char of the
multi-byte 'beta'.
/bin/echo -e "\x81\x30\x89\x38" | fgrep '0'
The echo outputs the multi-byte chars and fgrep matches the single-byte
0x30.
The attaching patch fixes bmexec() to work with the multi-byte chars.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: 2009年07月17日 08時20分26秒 Name:
grep-508811-head-fgrep-bmexec.diff Size: 2kB By: fujiwara
Patch for src/kwset.c
<http://savannah.gnu.org/patch/download.php?file_id=18429>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?6869>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/