Lines Matching refs:utf8
775 static int codepoint_to_utf8(char *utf8, int codepoint) in codepoint_to_utf8() argument
779 utf8[0] = codepoint; in codepoint_to_utf8()
785 utf8[0] = (codepoint >> 6) | 0xC0; in codepoint_to_utf8()
786 utf8[1] = (codepoint & 0x3F) | 0x80; 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()
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()
821 char utf8[4]; /* Surrogate pairs require 4 UTF-8 bytes */ in json_append_unicode_escape() local
866 len = codepoint_to_utf8(utf8, codepoint); in json_append_unicode_escape()
871 strbuf_append_mem_unsafe(json->tmp, utf8, len); in json_append_unicode_escape()