note 56297 added to function.convert-cyr-string
| From: | php-general at lists dot php dot net | Date: | Tue, 30 Aug 2005 05:50:57 +0000 |
| Subject: | note 56297 added to function.convert-cyr-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94363@lists.php.net to get a copy of this message | ||
//I've just added some chars to win3utf converter:
function win3utf($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==168) { $t.=chr(208).chr(129); continue; }; // ¨
if ($c==184) { $t.=chr(209).chr(145); continue; }; // ¸
if ($c==171) { $t.=chr(194).chr(171); continue; }; // «
if ($c==187) { $t.=chr(194).chr(187); continue; }; // »
if ($c==149) { $t.=chr(226).chr(128).chr(162); continue; }; //
if ($c==150) { $t.=chr(226).chr(128).chr(147); continue; }; //
if ($c==151) { $t.=chr(226).chr(128).chr(148); continue; }; //
if ($c==145) { $t.=chr(226).chr(128).chr(152); continue; }; //
if ($c==146) { $t.=chr(226).chr(128).chr(153); continue; }; //
if ($c==147) { $t.=chr(226).chr(128).chr(156); continue; }; //
if ($c==148) { $t.=chr(226).chr(128).chr(157); continue; }; //
}
return $t;
}
//you can check it by:
echo win3utf('ÀÁÂÃÄŨÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞß
àáâãä叿çèéêëìíîïðñòóôõö÷øùúûüýþÿ «» ');
----
Manual Page -- http://www.php.net/manual/en/function.convert-cyr-string.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56297
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56297&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56297&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56297&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56297&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56297&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56297&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56297&report=yes
Search -- http://master.php.net/manage/user-notes.php