Subject: Re: bug#23234: unexpected results with charset handling in GNU grep 2.23

From: Paul Eggert <[email-masked]>
Date: Sat, 9 Apr 2016 20:07:18 -0700

Norihiro Tanaka wrote:
> Hmm, diff does not output "Binary file matches" between text files, but
> grep does it.

I wasn't referring to the exact string "Binary file matches", merely to the idea 
that diff outputs a message to stdout saying that there was a binary file, 
rather than to stderr. Something like this:

$ diff /usr/bin/diff /usr/bin/emacs 2>/dev/null
Binary files /usr/bin/diff and /usr/bin/emacs differ

> When a user got "Binary file matches" from grep, he can distinguish
> whether matched a binary file or a line including "Binary file matches"
> of a text file from only this result.

Although that's a problem, it's not a serious one, as one can easily work around 
it by using -n or -H. If there were need, I suppose we could add another operand 
to the --binary option to cause it to do something else with a match.