y s ƌ ” µ છ x ‘ Ε Μ Ƭ
Unchanged: y s ƌ µ છ x Ε Μ Ƭ
Codepoints: 121 115 396 8221 181 2715 120 8216 917 924 428
In utf-8: y s ƌ ” µ છ x ‘ Ε Μ Ƭ
Highlighted with my highlighter.
<?phpfunctionstringToCodePoints($str) { $str=fixCharacters($str); $str=preg_replace_callback('/&#([0-9]+);/',create_function('$s','return $s[1];'), $str ); $str=preg_replace_callback('/&#x([a-f0-9]+);/i',create_function('$s','return hexdec($s[1]);'), $str );return$str; }functionstringToUtf8($str) { $str=fixCharacters($str); $str=preg_replace_callback('/&#([0-9]+);/',create_function('$s','return code2utf($s[1]);'), $str ); $str=preg_replace_callback('/&#x([a-f0-9]+);/i',create_function('$s','return code2utf(hexdec($s[1]));'), $str );return$str; }functionfixCharacters($str) { $r=array('€'=>'€',''=>'','‚'=>'‚','ƒ'=>'ƒ','„'=>'„','…'=>'…','†'=>'†','‡'=>'‡','ˆ'=>'ˆ','‰'=>'‰','Š'=>'Š','‹'=>'‹','Œ'=>'Œ',''=>'','Ž'=>'Ž',''=>'',''=>'','‘'=>'‘','’'=>'’','“'=>'“','”'=>'”','•'=>'•','–'=>'–','—'=>'—','˜'=>'˜','™'=>'™','š'=>'š','›'=>'›','œ'=>'œ',''=>'','ž'=>'ž','Ÿ'=>'Ÿ');returnstrtr($str, $r); }// From php.net:functioncode2utf($num){if($num<128) {returnchr($num); }if($num<2048) {returnchr(($num>>6)+192) .chr(($num &63)+128); }if($num<65536) {returnchr(($num>>12)+224) .chr((($num>>6) &63)+128) .chr(($num &63)+128); }if($num<2097152) {returnchr(($num>>18)+240) .chr((($num>>12) &63)+128) .chr((($num>>6) &63)+128) .chr(($num &63)+128); }return''; }?>