Reply to Re: Html-encode all characters not in the current character set

Your name:

Reply:


Posted by Timothy Madden on 04/27/07 13:36

shimmyshack wrote:
> On Apr 26, 1:23 pm, Timothy Madden <terminato...@gmail.com> wrote:
>> 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.
>>
[...]
>> Thank you,
>> Timothy Madden
>
> also mb_convert_encoding()
>

Actually I think mb_encode_numericentity() is the function I need.

mb_convert_encoding() will just re-encode a string from one encoding
to another, but a Latin-1 source simply can not include Latin-2
characters no matter what encoding I chose. I need numeric character
references defined by HTML for that.

Anyway I think mb_encode_numericentitiy() will work, I just need to know
how to create a map of code-point areas for it to work, and I don't
quite understand how such an area is defined.

Thank you,
Timothy Madden,
Romania

[Back to original 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

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