Subject: bug#21989: grep search by ASCII code unsuccessful

From: Shivanshu Goyal <[email-masked]>
Date: Sun, 22 Nov 2015 21:24:05 -0800

Hi,

I think I found a bug which did not exist in version 2.14, but does seem to
exist in versions 2.16 and 2.22. I have not tested any other versions.

Say there is a file with the following contents:

shivanshu@thetis:tmp$ cat temp | xxd
0000000: 68e2 8093 680a                           h...h.

The following is the grep 2.14 command and output:

shivanshu@thetis:tmp$ cat temp | grep -P '\xe2\x80\x93'
h–h

The following is the grep 2.16/2.22 command and output:

shivanshu@thetis:tmp$ cat temp | grep -P '\xe2\x80\x93'
d1y8@thetis:tmp$

Thanks,
Shivanshu Goyal
shivanshu.ca