note 66517 added to function.convert-cyr-string

From: Date: Wed, 24 May 2006 21:53:12 +0000
Subject: note 66517 added to function.convert-cyr-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-111971@lists.php.net to get a copy of this message
I have made mistake remove this test line: echo "<p>".ord($xchr)."</p>\n"; code should be like this: // Modificated by tapin13 // Corrected by Timuretis // Corrected by Sote for macedonian cyrillic // Convert win-1251 to utf-8 function unicode_mk_cyr($str) { $encode = ""; for ($ii=0;$ii<strlen($str);$ii++) { $xchr=substr($str,$ii,1); if (ord($xchr)>191) { $xchr=ord($xchr)+848; $xchr="&#" . $xchr . ";"; } if(ord($xchr) == 129) { $xchr = "&#1027;"; } if(ord($xchr) == 163) { $xchr = "&#1032;"; } if(ord($xchr) == 138) { $xchr = "&#1033;"; } if(ord($xchr) == 140) { $xchr = "&#1034;"; } if(ord($xchr) == 143) { $xchr = "&#1039;"; } if(ord($xchr) == 141) { $xchr = "&#1036;"; } if(ord($xchr) == 189) { $xchr = "&#1029;"; } if(ord($xchr) == 188) { $xchr = "&#1112;"; } if(ord($xchr) == 131) { $xchr = "&#1107;"; } if(ord($xchr) == 190) { $xchr = "&#1109;"; } if(ord($xchr) == 154) { $xchr = "&#1113;"; } if(ord($xchr) == 156) { $xchr = "&#1114;"; } if(ord($xchr) == 159) { $xchr = "&#1119;"; } if(ord($xchr) == 157) { $xchr = "&#1116;"; } $encode=$encode . $xchr; } return $encode; } ---- Server IP: 66.163.161.117 Probable Submitter: 62.162.229.92 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.convert-cyr-string.php Edit -- http://master.php.net/note/edit/66517 Del: integrated -- http://master.php.net/note/delete/66517/integrated Del: useless -- http://master.php.net/note/delete/66517/useless Del: bad code -- http://master.php.net/note/delete/66517/bad+code Del: spam -- http://master.php.net/note/delete/66517/spam Del: non-english -- http://master.php.net/note/delete/66517/non-english Del: in docs -- http://master.php.net/note/delete/66517/in+docs Del: other reasons-- http://master.php.net/note/delete/66517 Reject -- http://master.php.net/note/reject/66517 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#111971) next »