Comment 22 for bug 1535458

Revision history for this message
Martin Pitt (pitti) wrote :

grep 2.25 only stopped treating files as binary under the "C" locale, as that commonly means "I don't care about the encoding". AFAIK the behaviour did not change if you call it under a proper locale such as sv_SE.UTF-8. If you look at the file when it's encoded in a proper locale, it works:

$ iconv -f iso8859-1 -t utf8 /tmp/seen-binary-by-grep.txt
vMgs ingen lösning - the Swedish character o-umlaut
osmak ingen lösning
smak lösningen - the solution

(Note that the file is broken -- the first two non-ASCII ö characters are encoded in ISO-8859-1, and the last one is UTF-8).

And as described above, binary detection also is disabled under C:

$ LC_CTYPE=C grep ning /tmp/seen-binary-by-grep.txt
vMgs ingen l�sning - the Swedish character o-umlaut
osmak ingen l�sning
smak lösningen - the solution

So this is indeed not the same bug as bug 1547466, I retitled that one to clarify. It's much closer to http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19985.