note 49336 added to function.utf8-encode

From: Date: Mon, 24 Jan 2005 22:49:30 +0000
Subject: note 49336 added to function.utf8-encode
Groups: php.notes 
Request: Send a blank email to php-notes+get-83896@lists.php.net to get a copy of this message
A few bugs in your example code: function code2utf($num){ 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 -- http://master.php.net/manage/user-notes.php?action=edit+49336 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49336&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49336&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49336&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49336&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49336&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49336&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83896) next »