note 74395 added to ref.iconv

From: Date: Mon, 09 Apr 2007 21:43:41 +0000
Subject: note 74395 added to ref.iconv
Groups: php.notes 
Request: Send a blank email to php-notes+get-125244@lists.php.net to get a copy of this message
Just a little fix for the utf8_to_windows1255 function above. The original function doesn't convert English characters well: function utf8_to_windows1255($utf8) { $windows1255 = ""; $chars = preg_split("//",$utf8); for ($i=1; $i<count($chars)-1; $i++) { $prefix = ord($chars[$i]); $suffix = ord($chars[$i+1]); //print ("<p>$prefix $suffix"); if ($prefix==215) { $windows1255 .= chr($suffix+80); $i++; } elseif ($prefix==214) { $windows1255 .= chr($suffix+16); $i++; } else { $windows1255 .= $chars[$i]; } } return $windows1255; } ---- Server IP: 69.147.83.197 Probable Submitter: 89.0.236.23 ---- Manual Page -- http://www.php.net/manual/en/ref.iconv.php Edit -- https://master.php.net/note/edit/74395 Del: integrated -- https://master.php.net/note/delete/74395/integrated Del: useless -- https://master.php.net/note/delete/74395/useless Del: bad code -- https://master.php.net/note/delete/74395/bad+code Del: spam -- https://master.php.net/note/delete/74395/spam Del: non-english -- https://master.php.net/note/delete/74395/non-english Del: in docs -- https://master.php.net/note/delete/74395/in+docs Del: other reasons-- https://master.php.net/note/delete/74395 Reject -- https://master.php.net/note/reject/74395 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125244) next »