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