GNU bug report logs - #23234
unexpected results with charset handling in GNU grep 2.23

Previous Next

Package: grep;

Reported by: Björn JACKE <bjoern <at> j3e.de>

Date: Wed, 6 Apr 2016 20:45:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Bjoern Jacke <bjoern <at> j3e.de>, 23234 <at> debbugs.gnu.org
Subject: bug#23234: unexpected results with charset handling in GNU grep 2.23
Date: Wed, 6 Apr 2016 16:33:24 -0600
[Message part 1 (text/plain, inline)]
On 04/06/2016 04:23 PM, Bjoern Jacke wrote:
> On 06.04.2016 23:04, Eric Blake wrote:
>> The change of treating encoding errors as binary files will NOT be
>> reverted, but here,
> 
> hmm ... think of log files: In log files you will usually find all kind
> of encodings. If a user greps for a certain error message string in a
> log file he will not be able to find the errors because GNU grep will
> terminate grepping as soon as the first byte which does not fit into the
> locate encoding pops up.

'grep -a' is your friend.

> And what about the output of "Binary file (standard input) matches" on
> *stdout*? This is not distinguishable from a line that matched and
> contains this text. How should a script catch this situation?

That behavior complies with POSIX requirements.  Again, a script SHOULD
NOT be grepping binary files (POSIX only defines grep on text files)
without knowing the ramifications.  Meanwhile, 'grep -a' guarantees you
won't get the "Binary file" message.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 9 years and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.