grep treating my text files as binary!

Eric Blake eblake@redhat.com
Wed Dec 24 22:49:00 GMT 2014


On 12/24/2014 05:45 AM, zzapper wrote:
> Binary file /c/intranet/note/note.html matches
> 
> file note.html
> note.html: HTML document, Non-ISO extended-ASCII text, with CRLF line 
> terminators
> 
> 
> I know I can iconv them but why is this suddenly happening I'm unaware of 
> changing any of my settings??

You upgraded grep.  This is an intentional change in behavior in the
newest grep.  Work around it by using 'grep -a' or 'LC_ALL=C grep'.

Basically, the POSIX definition of a binary file includes any file that
is encoded incorrectly for the current locale, and since your current
locale is (probably) UTF-8 encoding, any file (such as note.html) that
assumes some other encoding (probably Latin-1 8-bit encoding) will be
treated as binary unless you request -a or change locales.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20141224/374f8cc2/attachment.sig>


More information about the Cygwin mailing list