This is the mail archive of the
mailing list for the Cygwin project.
Re: grep treating my text files as binary!
- From: Thomas Wolff <towo at towo dot net>
- To: cygwin at cygwin dot com
- Date: Thu, 25 Dec 2014 19:41:47 +0100
- Subject: Re: grep treating my text files as binary!
- Authentication-results: sourceware.org; auth=none
- References: <XnsA40D81CA1FAA8davidrayninfocouk at 80 dot 91 dot 229 dot 13> <549B4258 dot 5050509 at redhat dot com> <XnsA40DECB2AE256davidrayninfocouk at 80 dot 91 dot 229 dot 13>
Am 25.12.2014 um 00:16 schrieb zzapper:
Eric Blake <firstname.lastname@example.org> wrote in
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'.
Eric had further written:
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.
Thanks Eric, just surprised not to see more people bleating about this
- it resisted my Googling skills!
I actually had complained about this nonsense in the grep bug channel (a
and Eric had responded there, my further reply being pending... so let
me put it here for now;
I've read the POSIX definition of "binary file" that was quoted in the
grep bug already,
and if I remember correctly (or how this is abbreviated here...) it does
not mention character encoding or locale.
In any case the argument is quite artificial since the new behaviour
hits many files that are in fact text files.
Thus it is very undesirable from any reasonable users' point of view,
which should be the guideline for software design rather than dogmatic
locale theories. Therefore I hold the claim that this is a serious flaw
in grep and I hope it will be reverted.
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple