buggrep - Bugs: bug #23814, Result wrong in multibyte locale

 
 

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

bug #23814: Result wrong in multibyte locale

Submitter:  Norihirio Tanaka <noritnk>
Submitted:  Fri 11 Jul 2008 05:44:50 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Wed 23 Dec 2009 04:39:01 PM UTC, comment #1: 

Confirmed:

$ echo $'\xa4\xb3\xa4\xb3' | LANG=ja_JP.EUC-JP grep $'\xa4\xb3'
ここ
$ echo $'\xb3\xa4\xa4\xb3' | LANG=ja_JP.EUC-JP grep $'\xa4\xb3'
海こ
$ echo $'\xb3\xa4\xb3\xa4\xa4\xb3' | LANG=ja_JP.EUC-JP grep $'\xa4\xb3'
$

Cannot happen with UTF-8 because of how the encoding is done.

Paolo Bonzini <bonzini>
Fri 11 Jul 2008 05:44:50 AM UTC, original submission:  

If a part of multibyte character on a line matches with pattern,
and other part of same line, which isn't a part of multibyte
character, matches with pattern again, no its line is returned.

testcase
^^^^^^^^
test.txt : text file written in EUC-JP.
  byte sequence a4b3 a4b3 a4b3 b3a4 b3a4 000a (little endian)
pattern.txt : pattern file written in EUC-JP.
  byte sequence b3a4 b3a4 000a (little endian)

$ expor LANG=ja_JP.eucJP
$ grep -f pattern.txt test.txt

Last 4 bytes in the text matches with the pattern,
but not returned.

Norihirio Tanaka <noritnk>

 

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

Attached Files
file #16096:  test.txt added by noritnk (11B - text/plain)
file #16097:  pattern.txt added by noritnk (5B - text/plain)
file #16098:  grep-2.5.3-mbr.diff added by noritnk (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by noritnk (Submitted the item)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-03-17 bonzini StatusNone Fixed
        Open/ClosedOpen Closed
    2008-07-11 noritnk Attached File- Added test.txt, #16096
        Attached File- Added pattern.txt, #16097
        Attached File- Added grep-2.5.3-mbr.diff, #16098

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code