by tak » Sun May 23, 2010 4:14 am
Hi all,
I hope people still interest into this. I love the way RTE works. But, I'm having a problem, that some characters like "ố, ộ, đ". They don't display the way they should.Adding new article is OK, but when edit, calling the article from the database then the problem occur!
I tried this in the /inc/functions.inc.php:
function rteSafe($strText) {
//returns safe code for preloading into the RTE
$tmpString = $strText;
//convert all types of double quotes
$tmpString = str_replace(chr(147), chr(34), $tmpString);
$tmpString = str_replace(chr(148), chr(34), $tmpString);
//replace carriage returns & line feeds
$tmpString = str_replace(chr(10), " ", $tmpString);
$tmpString = str_replace(chr(13), " ", $tmpString);
//replace <, > to actual symbols
$tmpString = str_replace('<', '<', $tmpString);
$tmpString = str_replace('>', '>', $tmpString);
//convert all types of single quotes
$tmpString = str_replace(chr(145), chr(39), $tmpString);
$tmpString = str_replace(chr(146), chr(39), $tmpString);
$tmpString = str_replace("'", "'", $tmpString);
//convert some chracters
$tmpString = str_replace(chr(7889), ‘ố’, $tmpString);
$tmpString = str_replace(chr(7891), ‘ồ’, $tmpString);
$tmpString = str_replace(chr(7893), ‘ổ’, $tmpString);
$tmpString = str_replace(chr(7895), ‘ỗ’, $tmpString);
$tmpString = str_replace(chr(7897), ‘ộ’, $tmpString);
$tmpString = str_replace(chr(273), ‘đ’, $tmpString);
return $tmpString;
}
it did not help.
Please help. Thanks.
TAK