note 34214 deleted from function.utf8-encode by nlopess
| From: | nlopess@php.net | Date: | Thu, 01 Jul 2004 08:19:16 +0000 |
| Subject: | note 34214 deleted from function.utf8-encode by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72231@lists.php.net to get a copy of this message | ||
Note Submitter: hsheo@postech.ac.kr
----
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 '';
}