hello,
Tá mé ag tástáil sé ar mo fóram tástála (i Ní Ní féidir UTF) agus mé í a atáirgeadh ach is féidir leat triail seo a réiteach.
Tá mé rud éigin ar do shon:
1. oscailt, cóip a dhéanamh agus an gcomhad seo in eagar:
/ fréimhe fóram áirítear / vbenterprisetranslator_functions_utils.php
2. san fheidhm seo a aimsiú:
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. agus trácht gach líne gan ar ais mar seo amháin:
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. a shábháil agus tástála!
Ba chóir an obair seo ach amháin le haghaidh poist nua. gach post atá ann cheana féin ba chóir duit dul in eagar de láimh.
Agam nach shure go bhfuil tú ag ISO Is féidir le fóram ach tú tástáil air. Más rud é nach maith - le do thoil scríobh na n-athruithe rianta comhad d'aois