Home | History | Annotate | Download | only in cgpt

Lines Matching refs:utf8

421 /* Convert possibly unterminated UTF16 string to UTF8.
422 * Caller must prepare enough space for UTF8, which could be up to
426 * Code point UTF16 UTF8
440 uint8_t *utf8, unsigned int maxoutput)
447 if (!utf16 || !maxinput || !utf8 || !maxoutput)
484 utf8[s8idx++] = code_point & 0x7F;
487 utf8[s8idx++] = 0xC0 | (code_point >> 6);
488 utf8[s8idx++] = 0x80 | (code_point & 0x3F);
491 utf8[s8idx++] = 0xE0 | (code_point >> 12);
492 utf8[s8idx++] = 0x80 | ((code_point >> 6) & 0x3F);
493 utf8[s8idx++] = 0x80 | (code_point & 0x3F);
496 utf8[s8idx++] = 0xF0 | (code_point >> 18);
497 utf8[s8idx++] = 0x80 | ((code_point >> 12) & 0x3F);
498 utf8[s8idx++] = 0x80 | ((code_point >> 6) & 0x3F);
499 utf8[s8idx++] = 0x80 | (code_point & 0x3F);
507 utf8[s8idx++] = 0;
511 /* Convert UTF8 string to UTF16. The UTF8 string must be null-terminated.
514 * just needs to prepare the byte length of UTF8 plus the terminating 0x0000.
516 * Code point UTF16 UTF8
522 * This function converts UTF8 chars to a code point first. Then, convrts it
528 int UTF8ToUTF16(const uint8_t *utf8, uint16_t *utf16, unsigned int maxoutput)
536 if (!utf8 || !utf16 || !maxoutput)
542 utf8[s8idx] && maxoutput;
545 code_unit = utf8[s8idx];
621 /* A null-terminator shows up before the UTF8 sequence ends. */