Lines Matching refs:codepoint
775 static int codepoint_to_utf8(char *utf8, int codepoint) in codepoint_to_utf8() argument
778 if (codepoint <= 0x7F) { in codepoint_to_utf8()
779 utf8[0] = codepoint; in codepoint_to_utf8()
784 if (codepoint <= 0x7FF) { in codepoint_to_utf8()
785 utf8[0] = (codepoint >> 6) | 0xC0; in codepoint_to_utf8()
786 utf8[1] = (codepoint & 0x3F) | 0x80; in codepoint_to_utf8()
791 if (codepoint <= 0xFFFF) { in codepoint_to_utf8()
792 utf8[0] = (codepoint >> 12) | 0xE0; in codepoint_to_utf8()
793 utf8[1] = ((codepoint >> 6) & 0x3F) | 0x80; in codepoint_to_utf8()
794 utf8[2] = (codepoint & 0x3F) | 0x80; in codepoint_to_utf8()
799 if (codepoint <= 0x1FFFFF) { in codepoint_to_utf8()
800 utf8[0] = (codepoint >> 18) | 0xF0; in codepoint_to_utf8()
801 utf8[1] = ((codepoint >> 12) & 0x3F) | 0x80; in codepoint_to_utf8()
802 utf8[2] = ((codepoint >> 6) & 0x3F) | 0x80; in codepoint_to_utf8()
803 utf8[3] = (codepoint & 0x3F) | 0x80; in codepoint_to_utf8()
822 int codepoint; in json_append_unicode_escape() local
828 codepoint = decode_hex4(json->ptr + 2); in json_append_unicode_escape()
829 if (codepoint < 0) in json_append_unicode_escape()
838 if ((codepoint & 0xF800) == 0xD800) { in json_append_unicode_escape()
840 if (codepoint & 0x400) in json_append_unicode_escape()
859 codepoint = (codepoint & 0x3FF) << 10; in json_append_unicode_escape()
861 codepoint = (codepoint | surrogate_low) + 0x10000; in json_append_unicode_escape()
866 len = codepoint_to_utf8(utf8, codepoint); in json_append_unicode_escape()