protected function codePointToChar($code)
{
if ($code <= 0x7f) {
return chr($code);
} elseif ($code <= 0x7ff) {
return chr(($code >> 6) + 192) . chr(($code & 63) + 128);
} elseif ($code <= 0xffff) {
return chr(($code >> 12) + 224) . chr(($code >> 6 & 63) + 128) . chr(($code & 63) + 128);
} else {
return chr(($code >> 18) + 240) . chr(($code >> 12 & 63) + 128) . chr(($code >> 6 & 63) + 128) . chr(($code & 63) + 128);
}
}