Em Terça 17 Abril 2007 18:18, William Lovaton escreveu:
> Any idea with this one?  please??
>
> El lun, 02-04-2007 a las 07:51 -0500, William Lovaton escribió:
> > Hi there,
> >
> > I'd like to know a way to detect the file encoding from PHP and Linux
> > command line too.
> >
> > In PHP I tried mb_detect_encoding() but it doesn't work reliable, first
> > I have to specify a list of posible encodings and second it always
> > returns the first encoding I put in the list no matter what.
> >
> > Thanks for your help,
> >
> >
> > -William

You can use the file command:

[EMAIL PROTECTED] ~/documentos/txt $ file mac.txt
mac.txt: ASCII text
[EMAIL PROTECTED] ~/documentos/txt $ file noob.txt
noob.txt: UTF-8 Unicode text
[EMAIL PROTECTED] ~/documentos/txt $ file endereços.txt
endereços.txt: ASCII text
[EMAIL PROTECTED] ~/documentos/txt $ file coisas.txt
coisas.txt: UTF-8 Unicode English text



-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
"If you see an onion ring -- answer it!"

Attachment: pgpOz8zJQat5e.pgp
Description: PGP signature

Reply via email to