Add
{code} {code} == == * * _ _ [] * #

202

2017-01-12 15:44:07
function utf8_encode2($num) {
    if ($num <= 0x7f) {
        return chr($num);
    } else if ($num <= 0x07ff) {
        return chr(0xc0 | ($num >> 6)) . chr(0x80 | ($num & 0x3f));
    } else if ($num <= 0xffff) {
        return chr(0xe0 | ($num >> 12)) . chr(0x80 | ($num >> 10 & 0x3f)) . chr(0x80 | ($num & 0x3f));
    } else if ($num <= 0x1fffff) {
        return chr(0xf0 | ($num >> 18)) . chr(0x80 | ($num >> 12 & 0x2f)) . chr(0x80 | ($num >> 6 & 0x3f)) . chr($num & 0x3f);
    }
}