note 31791 added to function.convert-cyr-string

From: Date: Sat, 03 May 2003 22:13:49 +0000
Subject: note 31791 added to function.convert-cyr-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-47478@lists.php.net to get a copy of this message
previous bit of code (grmaxim's win_to_utf8 function) didn't work for me, so I wrote my own func to convert from win1251 to utf8: function win2utf($s) { for($i=0,$m=strlen($s);$i<$m;$i++) { $c=ord($s[$i]); if ($c>127) // convert only special chars if ($c==184) $t.=chr(209).chr(209); // small io elseif ($c==168) $t.=chr(208).chr(129); // capital io else $t.=($c>239?chr(209):chr(208)).chr($c-48); else $t.=$s[$i]; } return $t; } Hope this helps -- http://www.php.net/manual/en/function.convert-cyr-string.php http://master.php.net/manage/user-notes.php?action=edit+31791 http://master.php.net/manage/user-notes.php?action=delete+31791 http://master.php.net/manage/user-notes.php?action=reject+31791

« previous php.notes (#47478) next »