:: Re: [DNG] grep handles ISO-8859 enc…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Hendrik Boom
Date:  
À: dng
Sujet: Re: [DNG] grep handles ISO-8859 encoded text file as binary file.
On Thu, Apr 28, 2016 at 06:53:35AM +0000, Noel Torres wrote:
>
> Hughe Chung <janpenguin@???> escribió:
>
> >Hi,
> >
> >I got to use -a option to search words on C code files.
> >
> >
> >$ grep tesselate dome_math.c
> >Binary file dome_math.c matches
>
> Is this only due to encoding, or may be due to a DOS/Unix difference?
>
> If I were to bet, I would say that the file dome_math.c is not
> correctly formatted, or has an incorrect BOM at start, or so.


I've occasionally had a program that accepted UTF-8 reject a file
because it *had* a valid BOM at the start.

It was a C compiler that refused such a C program.

Don't know what other programs might do.

-- hendrik