Jörg Spieler - 2005-01-06 15:10:14
I've tried to convert a string from polish ISO-8859-2 to UTF8.
$utfConverter = new utf8(CP1252);
$text = $utfConverter->strToUtf8($text);
result:
Odznacza się wysok± smakowito¶ci±,
when I try this:
$tekscik = $text;
$tekscik = str_replace("±", "\xC4\x85", $tekscik);
$tekscik = str_replace('¡', "\xC4\x84", $tekscik);
$tekscik = str_replace('æ', "\xC4\x87", $tekscik);
$tekscik = str_replace('Æ', "\xC4\x86", $tekscik);
$tekscik = str_replace('ê', "\xC4\x99", $tekscik);
$tekscik = str_replace('Ê', "\xC4\x98", $tekscik);
$tekscik = str_replace('³', "\xC5\x82", $tekscik);
$tekscik = str_replace('£', "\xC5\x81", $tekscik);
$tekscik = str_replace('ó', "\xC3\xB3", $tekscik);
$tekscik = str_replace('Ó', "\xC3\x93", $tekscik);
$tekscik = str_replace('¶', "\xC5\x9B", $tekscik);
$tekscik = str_replace('¦', "\xC5\x9A", $tekscik);
$tekscik = str_replace('¼', "\xC5\xBC", $tekscik);
$tekscik = str_replace('¬', "\xC5\xBB", $tekscik);
$tekscik = str_replace('¿', "\xC5\xBA", $tekscik);
$tekscik = str_replace('¯', "\xC5\xB9", $tekscik);
$text = $tekscik;
(php.net-example)
I've got this correct result:
Odznacza się wysoką smakowitością,
Is there a bug?