News for hackers. Stuff that matters.
Re:If you use GNU grep on text files, use the -a (--text) op... by jwilk on Wednesday April 22, 2020 @04:29AM (#22943405)
I haven't looked at the GNU grep source, but yes, invalid UTF-8 is one of the reasons for treating file as binary:

   $ printf 'a\222b' | LC_ALL=en_US.UTF-8 grep a
   Binary file (standard input) matches
This is POSIX-compliant, because "character" is defined as:

> A sequence of one or more bytes representing a single graphic symbol or control code.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1...

There are no comments on this comment yet.