note 74112 added to ref.iconv
| From: | ErelSegal-RentaBrain at osu1 dot php dot net | Date: | Sun, 25 Mar 2007 19:32:44 +0000 |
| Subject: | note 74112 added to ref.iconv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124794@lists.php.net to get a copy of this message | ||
Note that my mysql_iconv will not translate correctly the Hebrew dotting symbols (Niqqud) - they
will be converted into question marks.
Here is a straightforward (and not very efficient) solution:
function utf8_to_windows1255($utf8) {
$windows1255 = "";
$chars = preg_split("//",$utf8);
for ($i=1; $i<count($chars)-1; $i+=2) {
$prefix = ord($chars[$i]);
$suffix = ord($chars[$i+1]);
print ("<p>$prefix $suffix");
if ($prefix==215)
$windows1255 .= chr($suffix+80);
elseif ($prefix==214)
$windows1255 .= chr($suffix+16);
else
$windows1255 .= $chars[$i];
}
return $windows1255;
}
----
Server IP: 192.117.122.43
Probable Submitter: 89.139.1.243
----
Manual Page -- http://www.php.net/manual/en/ref.iconv.php
Edit -- https://master.php.net/note/edit/74112
Del: integrated -- https://master.php.net/note/delete/74112/integrated
Del: useless -- https://master.php.net/note/delete/74112/useless
Del: bad code -- https://master.php.net/note/delete/74112/bad+code
Del: spam -- https://master.php.net/note/delete/74112/spam
Del: non-english -- https://master.php.net/note/delete/74112/non-english
Del: in docs -- https://master.php.net/note/delete/74112/in+docs
Del: other reasons-- https://master.php.net/note/delete/74112
Reject -- https://master.php.net/note/reject/74112
Search -- https://master.php.net/manage/user-notes.php