Lines Matching refs:codepoint
5 static inline unsigned int utf8_seqlen(long codepoint) in utf8_seqlen() argument
7 if(codepoint < 0x0000080) return 1; in utf8_seqlen()
8 if(codepoint < 0x0000800) return 2; in utf8_seqlen()
9 if(codepoint < 0x0010000) return 3; in utf8_seqlen()
10 if(codepoint < 0x0200000) return 4; in utf8_seqlen()
11 if(codepoint < 0x4000000) return 5; in utf8_seqlen()
16 static int fill_utf8(long codepoint, char *str) in fill_utf8() argument
18 int nbytes = utf8_seqlen(codepoint); in fill_utf8()
24 str[b] = 0x80 | (codepoint & 0x3f); in fill_utf8()
25 codepoint >>= 6; in fill_utf8()
29 case 1: str[0] = (codepoint & 0x7f); break; in fill_utf8()
30 case 2: str[0] = 0xc0 | (codepoint & 0x1f); break; in fill_utf8()
31 case 3: str[0] = 0xe0 | (codepoint & 0x0f); break; in fill_utf8()
32 case 4: str[0] = 0xf0 | (codepoint & 0x07); break; in fill_utf8()
33 case 5: str[0] = 0xf8 | (codepoint & 0x03); break; in fill_utf8()
34 case 6: str[0] = 0xfc | (codepoint & 0x01); break; in fill_utf8()