bug-grep
[Top][All Lists]
Advanced

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

[patch #6869] fgrep/egrep returns wrong matched none UTF-8 chars


From: Fujiwara
Subject: [patch #6869] fgrep/egrep returns wrong matched none UTF-8 chars
Date: Fri, 17 Jul 2009 08:20:28 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; ja; rv:1.9.1b4) Gecko/20090427 Fedora/3.5-0.20.beta4.fc11 Firefox/3.5b4

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/





reply via email to

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