grazie cmq vediamo di risolverlo sto problema..
grazie cmq vediamo di risolverlo sto problema..
Prova a vedere se questa risolve
Codice PHP:
if ( function_exists( 'mb_convert_encoding' ) )
{
$text = mb_convert_encoding( $text, $destination_cset, $original_cset );
}
else if ( function_exists( 'recode_string' ) )
{
$text = recode_string( $original_cset.'..'.$destination_cset, $text );
}
else if ( function_exists( 'iconv' ) )
{
$text = iconv( $original_cset, $destination_cset.'//TRANSLIT', $text);
}
Ma che ci metto quindi:
destination_cset, $original_cset
questi qui??
esempio di quello che faccio manualmente
$string=str_replace('\u00a3', "£", $string);
$string=str_replace('\u00f2', "ò", $string);
$string=str_replace('\u00f9', "ù", $string);
sul browser esce
<meta charset="UTF-8" />
che ci metto a quei valori?
grazie cmq
il collocation del mysql è utf8_general_ci
Hmm...mi viene il dubbio che quel che ti ho suggerito non vada bene...
Dammi un po' di tempo che vedo
ok grazie
Ok...vedi così se funge...
Codice PHP:
function unicode_decode($str){
return preg_replace("/\\\u([0-9A-F]{4})/ie", "hex2str(\"$1\")", $str);
}
function hex2str($hex) {
$r = '';
for ($i = 2; $i < strlen($hex) - 1; $i += 2){
$r .= chr(hexdec($hex[$i] . $hex[$i + 1]));
}
return $r;
}
$text = "Grazie mille per l'aiuto, \u00ec \u0031 \u00fc \u00e8";
$stringa_de_codificata = unicode_decode($text);
echo $stringa_de_codificata;