As far as I can tell, PHP provides no built in methods of working with multi byte characters.
Here is a simple function for turning an integer value into a character:
function unichr($intval) {
return mb_convert_encoding(pack('n', $intval), 'UTF-8', 'UTF-16BE');
}
A uniord() function can be found in the comments of the PHP manual:
http://us.php.net/manual/en/function.ord.php
Subscribe to:
Post Comments (Atom)
3 comments:
You can generate unicode characters in the following fashion:
"\u2063"
Why not simply pack('CC', 0x67, 0x62, 0x20, 0x2d, 0x20); or pack('nn', 0x6762, 0x202d); ?
@Rolf
In PHP, you cannot generate Unicode characters using the "\u" format in PHP. There's no way to directly encode
Post a Comment