bug-grep
[Top][All Lists]
Advanced

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

bug#18266: grep -P and invalid exits with error


From: Santiago
Subject: bug#18266: grep -P and invalid exits with error
Date: Thu, 14 Aug 2014 17:42:57 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

Hi,

Please, revert ca7868cc27db3d9deafaa2e0ac5a2bb0aa8ef373

That commit (re)introduced a regression bug (See http://debbugs.gnu.org/15758).
pcresearch checks again if input is UTF-8 valid. The problem is that
binary files are utf-8 invalid, so grep -P, in unicode locales, exits
with error:

LANG=en_US.UTF-8 grep -P -r x /usr/bin/
grep: invalid UTF-8 byte sequence in input



printf 'j\x82\nj\n'|LC_ALL=en_US.UTF-8 grep -P j|cat -A; echo $?
grep: invalid UTF-8 byte sequence in input
0

should be:
printf 'j\x82\nj\n'|LC_ALL=en_US.UTF-8 src/grep -P j|cat -A; echo $?
jM-^B$
j$
0

Tested on Debian and Archlinux with pcre 8.35.

Thanks,

Santiago






reply via email to

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