Re: How to detect charset encoding with PHP and command line?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:

davi@davi-linux ~/documentos/txt $ file mac.txt
mac.txt: ASCII text
davi@davi-linux ~/documentos/txt $ file noob.txt
noob.txt: UTF-8 Unicode text
davi@davi-linux ~/documentos/txt $ file endereços.txt
endereços.txt: ASCII text
davi@davi-linux ~/documentos/txt $ file coisas.txt
coisas.txt: UTF-8 Unicode English text



-- 
Davi Vidal
davividal@xxxxxxxxxxxxxxxx
davividal@xxxxxxxxx
--

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

Attachment: pgpQNevnjrykY.pgp
Description: PGP signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux