note 66505 added to function.convert-cyr-string
| From: | SoteKorveziroski at osu1 dot php dot net | 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 = "Ѓ";
}
if(ord($xchr) == 163) {
$xchr = "Ј";
}
if(ord($xchr) == 138) {
$xchr = "Љ";
}
if(ord($xchr) == 140) {
$xchr = "Њ";
}
if(ord($xchr) == 143) {
$xchr = "Џ";
}
if(ord($xchr) == 141) {
$xchr = "Ќ";
}
if(ord($xchr) == 189) {
$xchr = "Ѕ";
}
if(ord($xchr) == 188) {
$xchr = "ј";
}
if(ord($xchr) == 131) {
$xchr = "ѓ";
}
if(ord($xchr) == 190) {
$xchr = "ѕ";
}
if(ord($xchr) == 154) {
$xchr = "љ";
}
if(ord($xchr) == 156) {
$xchr = "њ";
}
if(ord($xchr) == 159) {
$xchr = "џ";
}
if(ord($xchr) == 157) {
$xchr = "ќ";
}
$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