Lines Matching refs:out_utf8
272 * @out_utf8: output buffer of at least 4 bytes or NULL
275 * This encodes a single UCS-4 character as UTF-8 and writes it into @out_utf8.
282 size_t utf8_encode_unichar(char *out_utf8, char32_t g) {
285 if (out_utf8)
286 out_utf8[0] = g & 0x7f;
289 if (out_utf8) {
290 out_utf8[0] = 0xc0 | ((g >> 6) & 0x1f);
291 out_utf8[1] = 0x80 | (g & 0x3f);
295 if (out_utf8) {
296 out_utf8[0] = 0xe0 | ((g >> 12) & 0x0f);
297 out_utf8[1] = 0x80 | ((g >> 6) & 0x3f);
298 out_utf8[2] = 0x80 | (g & 0x3f);
302 if (out_utf8) {
303 out_utf8[0] = 0xf0 | ((g >> 18) & 0x07);
304 out_utf8[1] = 0x80 | ((g >> 12) & 0x3f);
305 out_utf8[2] = 0x80 | ((g >> 6) & 0x3f);
306 out_utf8[3] = 0x80 | (g & 0x3f);