GNU bug report logs - #20526
BUG: text file is detected as binary

Previous Next

Package: grep;

Reported by: Sebastian Poehn <sebastian.poehn <at> gmail.com>

Date: Thu, 7 May 2015 15:41:03 UTC

Severity: normal

Merged with 19230, 19985, 21558

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 20526 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Sebastian Pöhn <sebastian.poehn <at> gmail.com>
Cc: 20526 <at> debbugs.gnu.org
Subject: Re: bug#20526: BUG: text file is detected as binary
Date: Thu, 07 May 2015 13:07:20 -0700
[Message part 1 (text/plain, inline)]
On 05/07/2015 10:47 AM, Sebastian Pöhn wrote:
>
> Thanks for this fast feedback. Your explanation sounds very 
> reasonable. As you may have noticed this a makefile out of openwrt 
> with is mainlined there.
>
> 1) I downgraded to grep 2.20. Issue is gone with the same environment. 
> So this is in my eyes a regression.
>

Not really, as Openwrt is relying on undefined behavior.  The spec for 
grep has never defined what grep does when you feed it binary data that 
is not properly encoded for the current locale.  Different versions of 
grep (and we're not just talking GNU grep here, but other 
implementations) do different things.  Some grep implementations dump 
core.  These behaviors all conform to the spec.  (Well, GNU grep isn't 
supposed to dump core, but older versions of GNU grep are buggy and will 
dump core sometimes anyway, so you'll need good luck with them.)

> 2) I will also open a report at fedora, maybe the use some strange 
> setting in building the new packet.
>

Nowadays most people are using UTF-8, so I suggest encoding the 
Makefiles in UTF-8 and specifying a UTF-8 locale when you build. Another 
possibility is the attached hack (I haven't tried it).  The most 
conservative course would be to insist that Makefiles be ASCII, although 
....

> 3) I will send a short notice to openwrt asking if they think it is 
> fine to use ë or ö. I personally have a strong opinion on that ;)
>

Don't blame you a bit.
[openwrt.diff (text/x-patch, attachment)]

This bug report was last modified 9 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.