Forum Webscript.Ru
Программирование => PHP => Тема начата: Mefisto от 22 Мая 2003, 22:54:25
-
как реализовать сабж на PHP?
-
utf8_encode / utf8_decode ?
-
semya:
utf8_encode / utf8_decode ?
эти функции не перекодируют win1251
я нашел такую функцию, если кому надо:
//перекодировка win->unicode
function cyr_code ($in_text){
$output="";
$other[1025]="Ё";
$other[1105]="ё";
$other[1028]="Є";
$other[1108]="є";
$other[1030]="I";
$other[1110]="i";
$other[1031]="Ї";
$other[1111]="ї";
for ($i=0; $i if (ord($in_text{$i})>191){
$output.="".(ord($in_text{$i})+848).";";
} else {
if (array_search($in_text{$i}, $other)===false){
$output.=$in_text{$i};
} else {
$output.="".array_search($in_text{$i}, $other).";";
}
}
}
return $output;
}
?>
-
http://t124.ram.ru/xconvert.php.txt