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

Submitted by:  Norihirio Tanaka <noritnk>
Submitted on:  Fri 11 Jul 2008 05:44:50 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned 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>

 

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
  • -unavailable- added by bonzini (Posted a comment)
  • -unavailable- added by noritnk (Submitted the item)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 17 Mar 2010 09:55:47 AM UTCbonziniStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 11 Jul 2008 05:44:50 AM UTCnoritnkAttached 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.1-cleanup1