You are here: Re: How to determine if a file is UTF8 encoded? « PHP Programming Language « IT news, forums, messages
Re: How to determine if a file is UTF8 encoded?

Posted by daemon on 11/18/05 18:32

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Podlesak wrote:
> I need a check, if a file is utf8 encoded. I only found the php-functions
> 'iconv' and 'recode'. But it seems it´s not possible to determine the
> encoding with them. Isn´t there any similar function to the 'file'-command
> on linux for php?

Ok, I'm barly understanding your request. UTF/UTF8/UTF16 affects the
character set of your file. Now all HTML files can configure the browser
to determin the character set just be defining:

<meta http-equiv="Content-Type" content="application/xml+xhtml;
charset=UTF-8" />

As well, if your sending PHP encoded file, you can pre-determin the
filetype just by defining the character encoding threw the headers:

header("Content-Type: application/xml+xhtml; charset=utf-8");

Other then that, the rest is done threw your web server, picking the
file... that if you wanted to encode it further you would have to
convert it using the functions you said above.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDfmPQ/WE0aXnOUiYRArvoAJ4tE6s7WPSRtBZg1tLdFgJmFL5MNQCbBKUe
GR3X5SE21hzNzW4k2UOh7f8=
=xJ0s
-----END PGP SIGNATURE-----

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация