שלום,
אני בודק את זה בפורום של המבחן שלי (ב לא UTF) ואני לא יכול לשחזר את זה, אבל אתה יכול לנסות את הפתרון הזה.
יש לי משהו בשבילך:
1. לפתוח, ליצור עותק ולערוך את הקובץ הזה:
בפורום / root כולל / 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 בפורום אבל אתה יכול לבדוק את זה. אם לא טוב - בבקשה להחליף את הקובץ הישן שינויים bu