Subject: Re: bug#20526: BUG: text file is detected as binary

From: Paul Eggert <[email-masked]>
Date: Fri, 08 May 2015 09:27:45 -0700

Sebastian Poehn wrote:
> They changed all Makefiles not being ASCII
> to UTF-8 three months ago as they run into exactly this.

Hah!  Great minds think alike.

But they missed a few files (not Makefiles).  The following shell command finds 
every openwrt file that's not UTF-8 (and isn't obviously binary).  It works 
because '.' matches only properly-encoded characters.  You may need a new GNU 
grep for this command to be reliable.

LC_ALL=en_US.utf8 grep -lv '^.*$' \
   $(git ls-files | grep -Ev '\.(patch|bin|squashfs)$')