A better function to convert cp1251 string to utf8.
Works with russian and ukrainian text.
function unicod($str) {
$conv=array();
for($x=128;$x<=143;$x++) $conv[$x+112]=chr(209).chr($x);
for($x=144;$x<=191;$x++) $conv[$x+48]=chr(208).chr($x);
$conv[184]=chr(209).chr(145); #ё
$conv[168]=chr(208).chr(129); #Ё
$conv[179]=chr(209).chr(150); #і
$conv[178]=chr(208).chr(134); #І
$conv[191]=chr(209).chr(151); #ї
$conv[175]=chr(208).chr(135); #ї
$conv[186]=chr(209).chr(148); #є
$conv[170]=chr(208).chr(132); #Є
$conv[180]=chr(210).chr(145); #ґ
$conv[165]=chr(210).chr(144); #Ґ
$conv[184]=chr(209).chr(145); #Ґ
$ar=str_split($str);
foreach($ar as $b) if(isset($conv[ord($b)])) $nstr.=$conv[ord($b)]; else $nstr.=$b;
return $nstr;
}