Hello,
ผมทดสอบบนฟอรั่มการทดสอบของฉัน (ใน ไม่ UTF) และฉันไม่สามารถที่จะทำซ้ำมัน แต่คุณสามารถลองแก้ปัญหานี้
ฉันมีบางอย่างสำหรับคุณ :
1 เปิดให้ทำสำเนาและแก้ไขไฟล์นี้ :
ฟอรั่มราก / includes / vbenterprisetranslator_functions_utils.php
2 ในงานนี้พบกับ :
PHP Code:
function vbet_encodeToSafeUTF8(&$string) {
//TODO how to check does utf-8 is involved? how often this function is used?
// if (! ereg('[\200-\237]', $string) and ! ereg('[\241-\377]', $string))
// if (!preg_match('/[\200-\237]/', $string) and !preg_match('/[\241-\377]/', $string))
// if (!preg_match('/[\200-\237\241-\377]/e', $string))
// return $string;
// decode three byte unicode characters
$string = preg_replace('/([\340-\357])([\200-\277])([\200-\277])/e',
'\'&#\'.((ord(\'\\1\')-224)*4096 + (ord(\'\\2\')-128)*64 + (ord(\'\\3\')-128)).\';\'',
$string);
//decode two byte unicode characters
$string = preg_replace('/([\300-\337])([\200-\277])/e',
'\'&#\'.((ord(\'\\1\')-192)*64+(ord(\'\\2\')-128)).\';\'',
$string);
return $string;
}
3 และแสดงความคิดเห็นทุกบรรทัดโดยไม่ต้อง กลับ เช่นนี้ :
PHP Code:
function vbet_encodeToSafeUTF8(&$string) {
//TODO how to check does utf-8 is involved? how often this function is used?
// if (! ereg('[\200-\237]', $string) and ! ereg('[\241-\377]', $string))
// if (!preg_match('/[\200-\237]/', $string) and !preg_match('/[\241-\377]/', $string))
// if (!preg_match('/[\200-\237\241-\377]/e', $string))
// return $string;
// decode three byte unicode characters
// $string = preg_replace('/([\340-\357])([\200-\277])([\200-\277])/e',
// '\'&#\'.((ord(\'\\1\')-224)*4096 + (ord(\'\\2\')-128)*64 + (ord(\'\\3\')-128)).\';\'',
// $string);
//decode two byte unicode characters
//$string = preg_replace('/([\300-\337])([\200-\277])/e',
// '\'&#\'.((ord(\'\\1\')-192)*64+(ord(\'\\2\')-128)).\';\'',
// $string);
return $string;
}
4 บันทึกและทดสอบ!
นี้ควรจะทำงานเฉพาะสำหรับการโพสต์ใหม่ โพสต์ทั้งหมดที่มีอยู่แล้วคุณควรแก้ไขด้วยมือ
ฉันไม่ SHURE ที่คุณมี ISO ฟอรั่ม แต่คุณสามารถทดสอบได้ ถ้าไม่ดี -- โปรดเขียนทับการเปลี่ยนแปลงบุเหล่านี้ไฟล์เก่า