[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22838: New 'Binary file' detection considered harmful
From: |
Jim Meyering |
Subject: |
bug#22838: New 'Binary file' detection considered harmful |
Date: |
Mon, 29 Feb 2016 17:23:45 -0800 |
On Mon, Feb 29, 2016 at 3:35 PM, Paul Eggert <address@hidden> wrote:
> On 02/29/2016 12:34 PM, Marcello Perathoner wrote:
...
>> Since 2.21 I will now have to always specify -a or LC_ALL=C when
>> grepping my files.
>
> I suggest using -a. LC_ALL=C won't work the way that you want on platforms
> where the C locale is UTF-8, or is pure ASCII. For example, on Fedora 23 or
> RHEL 7 with grep 2.23 we have:
>
> $ printf '\200\n' | LC_ALL=C grep .
> Binary file (standard input) matches
>
> This is because the C locale is pure ASCII on these platforms, i.e., '\200'
> is not a valid character the way it is with traditional Unix. I don't know
> why Red Hat made that change.
Wow. I hadn't noticed that using LC_ALL=C is inadequate.
Disturbing...
- bug#22838: New 'Binary file' detection considered harmful, (continued)
- bug#22838: New 'Binary file' detection considered harmful, Eric Blake, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Eric Blake, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Marcello Perathoner, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Holger Bruenjes, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Eric Blake, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Paul Eggert, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Marcello Perathoner, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Paul Eggert, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Eric Blake, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful, Hans Pelleboer, 2016/02/29
- bug#22838: New 'Binary file' detection considered harmful,
Jim Meyering <=
- bug#22838: New 'Binary file' detection considered harmful, Bruce Dubbs, 2016/02/29