|
Posted by Vince Morgan on 04/26/07 13:36
"Timothy Madden" <terminatorul@gmail.com> wrote in message
news:4630999f$0$90266$14726298@news.sunsite.dk...
> Hello
>
> Is there a function that will allow me to
> output text written in utf-8 (from db for example)
> if my document has
>
> Content-Type: text/html; charset=ISO-8859-1
>
> I mean htmlspecialchars() and htmlentities() will only convert
> characters that have an associated entity defined in HTML.
> I would also like to translate all non-latin1 characters using
> numeric references.
>
> ţ is for a Romanian letter, t, for example, and letter t
> written in UTF-8 is not translated by htmlentities(), even if
> I give the function the optional character-set argument, 'UTF-8'
> (you can actually see the letter I typed if your system and your
> news reader understand and can display ISO latin 2 characters,
> encoded in utf-8).
>
> I mean HTML documents can use characters in the entire UNICODE
> set, even if the document source is written in ASCII for example,
> by encoding any non-ASCII character with HTML entities.
>
> Is there in PHP a function that will encode in HTML all non-ASCII
> characters, or all non-latin1 characters, or all characters not in the
> source character set ?
You may find the following link usefull;
http://au.php.net/utf8-decode
HTH
Vince
Navigation:
[Reply to this message]
|