note 34214 added to function.utf8-encode

From: Date: Fri, 18 Jul 2003 15:26:52 +0000
Subject: note 34214 added to function.utf8-encode
Groups: php.notes 
Request: Send a blank email to php-notes+get-52338@lists.php.net to get a copy of this message
fixed some bug... function code2utf($num){ //Returns the utf string corresponding to the unicode value //courtesy - romans@void.lv if($num<128)return chr($num); if($num<2048)return chr(($num>>6)+192).chr(($num&63)+128); if($num<65536)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128); if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128). chr(($num&63)+128); return ''; } ---- Manual Page -- http://www.php.net/manual/en/function.utf8-encode.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34214 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34214&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34214&report=yes

« previous php.notes (#52338) next »