אַ גוט יאָר,
איך בין טעסטינג עס אויף מיין פּרובירן פאָרום (אין ניט UTF) און איך קען נישט צו רעפּראָדוצירן עס אָבער איר קענען פּרובירן דעם לייזונג.
איך האָבן עפּעס פֿאַר איר:
1. עפענען, מאַכן אַ קאָפּיע און רעדאַגירן דעם טעקע:
פאָרום שורש / כולל / וובענטערפּריסעטראַנסלאַטאָר_פונקטיאָנס_וטילס.פפּ
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. שפּאָרן און פּרובירן!
דעם זאָל אַרבעטן נאָר פֿאַר נייַ הודעות. אַלע יגזיסטינג הודעות איר זאָל רעדאַגירן דורך האַנט.
איך ניט שור אַז איר האָבן אַ יסאָ פאָרום אָבער איר קענען פּרובירן עס. אויב נישט גוט - ביטע אָווועררייט די ענדערונגען בו אַלט טעקע