leoyue
05-24-2006, 05:33 PM
It's need to change few code, I try to list those modifytions here just as your referrence.
It's will also be useful if you use Korean , Japanese or other Mutile-Byte language.
correct me, if I'm wrong.
//Change1: admin/rte/funtions.php
//Problem: 1% chinese character will change to ? or ??
function rteSafe($strText) {
//returns safe code for preloading in the RTE
$translate = array(
"?" => "đ", // "‘" => "đ",
"?" => "ђ", // "Ñ" => "ђ",
);
$tmpString = StrTr($strText, $translate);
//$tmpString = $strText;
//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 all types of double quotes
//$tmpString = str_replace(chr(147), chr(34), $tmpString);
//$tmpString = str_replace(chr(148), chr(34), $tmpString);
// $tmpString = str_replace("\"", "\"", $tmpString);
//replace carriage returns & line feeds
$tmpString = str_replace(chr(10), " ", $tmpString);
$tmpString = str_replace(chr(13), " ", $tmpString);
// $tmpString = str_replace(chr(273), "đ", $tmpString);
return $tmpString;
}
It's will also be useful if you use Korean , Japanese or other Mutile-Byte language.
correct me, if I'm wrong.
//Change1: admin/rte/funtions.php
//Problem: 1% chinese character will change to ? or ??
function rteSafe($strText) {
//returns safe code for preloading in the RTE
$translate = array(
"?" => "đ", // "‘" => "đ",
"?" => "ђ", // "Ñ" => "ђ",
);
$tmpString = StrTr($strText, $translate);
//$tmpString = $strText;
//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 all types of double quotes
//$tmpString = str_replace(chr(147), chr(34), $tmpString);
//$tmpString = str_replace(chr(148), chr(34), $tmpString);
// $tmpString = str_replace("\"", "\"", $tmpString);
//replace carriage returns & line feeds
$tmpString = str_replace(chr(10), " ", $tmpString);
$tmpString = str_replace(chr(13), " ", $tmpString);
// $tmpString = str_replace(chr(273), "đ", $tmpString);
return $tmpString;
}