Lines Matching refs:utf
203 static int codepoint2utf8(unsigned char *out, unsigned long utf) in codepoint2utf8() argument
205 if (utf <= 0x7F) { in codepoint2utf8()
207 out[0] = (unsigned char)utf; in codepoint2utf8()
210 } else if (utf <= 0x07FF) { in codepoint2utf8()
212 out[0] = (unsigned char)(((utf >> 6) & 0x1F) | 0xC0); in codepoint2utf8()
213 out[1] = (unsigned char)(((utf >> 0) & 0x3F) | 0x80); in codepoint2utf8()
216 } else if (utf <= 0xFFFF) { in codepoint2utf8()
218 out[0] = (unsigned char)(((utf >> 12) & 0x0F) | 0xE0); in codepoint2utf8()
219 out[1] = (unsigned char)(((utf >> 6) & 0x3F) | 0x80); in codepoint2utf8()
220 out[2] = (unsigned char)(((utf >> 0) & 0x3F) | 0x80); in codepoint2utf8()
223 } else if (utf <= 0x10FFFF) { in codepoint2utf8()
225 out[0] = (unsigned char)(((utf >> 18) & 0x07) | 0xF0); in codepoint2utf8()
226 out[1] = (unsigned char)(((utf >> 12) & 0x3F) | 0x80); in codepoint2utf8()
227 out[2] = (unsigned char)(((utf >> 6) & 0x3F) | 0x80); in codepoint2utf8()
228 out[3] = (unsigned char)(((utf >> 0) & 0x3F) | 0x80); in codepoint2utf8()