Lines Matching refs:codepoint
1901 * Converts a unicode codepoint to a UTF-8 character
1904 * @param int $codepoint Unicode codepoint
1907 public static function codepoint_to_utf8($codepoint)
1909 $codepoint = (int) $codepoint;
1910 if ($codepoint < 0) {
1912 } elseif ($codepoint <= 0x7f) {
1913 return chr($codepoint);
1914 } elseif ($codepoint <= 0x7ff) {
1915 return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
1916 } elseif ($codepoint <= 0xffff) {
1917 return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
1918 } elseif ($codepoint <= 0x10ffff) {
1919 return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));