note 82755 added to function.convert-cyr-string
| From: | web at uit dot kiev dot ua | Date: | Thu, 24 Apr 2008 14:42:54 +0000 |
| Subject: | note 82755 added to function.convert-cyr-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138740@lists.php.net to get a copy of this message | ||
real convert windows-1251 to utf-8 (ukrainian, russian)
function win2utf($s) {
for($i=0, $m=strlen($s); $i<$m; $i++) {
$c=ord($s[$i]);
if ($c<=127) {$t.=chr($c); continue; }
if ($c>=192 && $c<=207) {$t.=chr(208).chr($c-48); continue; }
if ($c>=208 && $c<=239) {$t.=chr(208).chr($c-48); continue; }
if ($c>=240 && $c<=255) {$t.=chr(209).chr($c-112); continue; }
if ($c==184) { $t.=chr(209).chr(209); continue; };
if ($c==168) { $t.=chr(208).chr(129); continue; };
if ($c==184) { $t.=chr(209).chr(145); continue; }; #Ñ
if ($c==168) { $t.=chr(208).chr(129); continue; }; #Ð
if ($c==179) { $t.=chr(209).chr(150); continue; }; #Ñ
if ($c==178) { $t.=chr(208).chr(134); continue; }; #Ð
if ($c==191) { $t.=chr(209).chr(151); continue; }; #Ñ
if ($c==175) { $t.=chr(208).chr(135); continue; }; #Ñ
if ($c==186) { $t.=chr(209).chr(148); continue; }; #Ñ
if ($c==170) { $t.=chr(208).chr(132); continue; }; #Ð
if ($c==180) { $t.=chr(210).chr(145); continue; }; #Ò
if ($c==165) { $t.=chr(210).chr(144); continue; }; #Ò
if ($c==184) { $t.=chr(209).chr(145); continue; }; #Ò
}
return $t;
}
----
Server IP: 213.186.192.247
Probable Submitter: 217.20.175.29
----
Manual Page -- http://www.php.net/manual/en/function.convert-cyr-string.php
Edit -- https://master.php.net/note/edit/82755
Del: integrated -- https://master.php.net/note/delete/82755/integrated
Del: useless -- https://master.php.net/note/delete/82755/useless
Del: bad code -- https://master.php.net/note/delete/82755/bad+code
Del: spam -- https://master.php.net/note/delete/82755/spam
Del: non-english -- https://master.php.net/note/delete/82755/non-english
Del: in docs -- https://master.php.net/note/delete/82755/in+docs
Del: other reasons-- https://master.php.net/note/delete/82755
Reject -- https://master.php.net/note/reject/82755
Search -- https://master.php.net/manage/user-notes.php