You are here: [multibyte-safe htmlentities()] « PHP Programming Language « IT news, forums, messages
[multibyte-safe htmlentities()]

Posted by Thorsten Ottosen on 03/23/06 00:48

Hi,

I'm trying to escape html before its saved in a database.

I tried

$text = htmlentities( $reader->value );

but that don't work for e.g. japanese characters.

I then tried

$text = mb_convert_encoding( $text, 'HTML-ENTITIES', 'UTF-16' );

because the text-file is encode in UTF-16.

But that in particular doesn't work. If I specify 'UTF-8'
the text looks normal, but nothing is escaped så html tags still
appears as tags.

can anyone suggest what to do?

Thanks

-Thorsten

 

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

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