note 66517 added to function.convert-cyr-string
| From: | SoteKorveziroski at osu1 dot php dot net | 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 = "Ѓ";
}
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.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