Home
last modified time | relevance | path

Searched refs:wchar (Results 1 – 2 of 2) sorted by relevance

/illumos-kvm-cmd/
H A Dqjson.c145 uint16_t wchar; in to_json() local
148 wchar = (ptr[0] & 0x0F) << 12; in to_json()
149 wchar |= (ptr[1] & 0x3F) << 6; in to_json()
150 wchar |= (ptr[2] & 0x3F); in to_json()
153 snprintf(escape, sizeof(escape), "\\u%04X", wchar); in to_json()
156 uint16_t wchar; in to_json() local
159 wchar = (ptr[0] & 0x1F) << 6; in to_json()
160 wchar |= (ptr[1] & 0x3F); in to_json()
163 snprintf(escape, sizeof(escape), "\\u%04X", wchar); in to_json()
H A Djson-parser.c110 static void wchar_to_utf8(uint16_t wchar, char *buffer, size_t buffer_length) in wchar_to_utf8() argument
112 if (wchar <= 0x007F) { in wchar_to_utf8()
115 buffer[0] = wchar & 0x7F; in wchar_to_utf8()
117 } else if (wchar <= 0x07FF) { in wchar_to_utf8()
120 buffer[0] = 0xC0 | ((wchar >> 6) & 0x1F); in wchar_to_utf8()
121 buffer[1] = 0x80 | (wchar & 0x3F); in wchar_to_utf8()
126 buffer[0] = 0xE0 | ((wchar >> 12) & 0x0F); in wchar_to_utf8()
127 buffer[1] = 0x80 | ((wchar >> 6) & 0x3F); in wchar_to_utf8()
128 buffer[2] = 0x80 | (wchar & 0x3F); in wchar_to_utf8()

Completed in 7 milliseconds