note 66505 added to function.convert-cyr-string

From: Date: Wed, 24 May 2006 17:24:47 +0000
Subject: note 66505 added to function.convert-cyr-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-111950@lists.php.net to get a copy of this message
Only this code works OK for me, for translating win-1251 to utf-8 for macedonian letters! // 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); echo "<p>".ord($xchr)."</p>\n"; 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.178 ---- X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER, HTML_MESSAGE 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/66505 Del: integrated -- http://master.php.net/note/delete/66505/integrated Del: useless -- http://master.php.net/note/delete/66505/useless Del: bad code -- http://master.php.net/note/delete/66505/bad+code Del: spam -- http://master.php.net/note/delete/66505/spam Del: non-english -- http://master.php.net/note/delete/66505/non-english Del: in docs -- http://master.php.net/note/delete/66505/in+docs Del: other reasons-- http://master.php.net/note/delete/66505 Reject -- http://master.php.net/note/reject/66505 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#111950) next »