Lines Matching +full:0 +full:x3f
34 #define UNICODE_DECOMPOSE 0x01
35 #define UNICODE_PRECOMPOSE 0x02
36 #define UNICODE_UTF8_LATIN1_FALLBACK 0x03
51 #define IS_CONT(c) (((c)&0xc0) == 0x80) in utf8_to_utf16()
53 error = 0; in utf8_to_utf16()
55 spos = dpos = 0; in utf8_to_utf16()
57 if (s[spos] < 0x80) in utf8_to_utf16()
61 && s[spos]>=0xa0) { in utf8_to_utf16()
65 else if (s[spos] < 0xc0 || s[spos] >= 0xf5) { in utf8_to_utf16()
67 or lead byte for codepoint above 0x10ffff */ in utf8_to_utf16()
72 else if (s[spos] < 0xe0) { in utf8_to_utf16()
78 c = ((s[spos] & 0x3f) << 6) | (s[spos+1] & 0x3f); in utf8_to_utf16()
80 if (c < 0x80) { in utf8_to_utf16()
86 else if (s[spos] < 0xf0) { in utf8_to_utf16()
93 c = ((s[spos] & 0x0f) << 12) | ((s[spos+1] & 0x3f) << 6) in utf8_to_utf16()
94 | (s[spos+2] & 0x3f); in utf8_to_utf16()
96 if (c < 0x800 || (c & 0xdf00) == 0xd800 ) { in utf8_to_utf16()
113 cc = ((s[spos] & 0x03) << 18) | ((s[spos+1] & 0x3f) << 12) in utf8_to_utf16()
114 | ((s[spos+2] & 0x3f) << 6) | (s[spos+3] & 0x3f); in utf8_to_utf16()
116 if (cc < 0x10000) { in utf8_to_utf16()
122 dst[dpos] = (0xd800 | ((cc-0x10000)>>10)); in utf8_to_utf16()
124 c = 0xdc00 | ((cc-0x10000) & 0x3ffff); in utf8_to_utf16()
150 #define ADD_BYTE(b) (dst ? dst[dpos] = (b) : 0, dpos++) in utf16_to_utf8()
152 error = 0; in utf16_to_utf8()
153 dpos = 0; in utf16_to_utf8()
154 for (spos=0; spos<src_len; spos++) { in utf16_to_utf8()
155 if (src[spos] < 0x80) { in utf16_to_utf8()
159 else if (src[spos] < 0x800) { in utf16_to_utf8()
161 ADD_BYTE(0xc0 | (src[spos]>>6)); in utf16_to_utf8()
162 ADD_BYTE(0x80 | (src[spos] & 0x3f)); in utf16_to_utf8()
164 else if ((src[spos] & 0xdc00) == 0xd800) { in utf16_to_utf8()
167 if (spos == src_len - 1 || (src[spos] & 0xdc00) != 0xdc00) { in utf16_to_utf8()
174 c = (((src[spos]&0x3ff) << 10) | (src[spos+1]&0x3ff)) + 0x10000; in utf16_to_utf8()
175 ADD_BYTE(0xf0 | (c>>18)); in utf16_to_utf8()
176 ADD_BYTE(0x80 | ((c>>12) & 0x3f)); in utf16_to_utf8()
177 ADD_BYTE(0x80 | ((c>>6) & 0x3f)); in utf16_to_utf8()
178 ADD_BYTE(0x80 | (c & 0x3f)); in utf16_to_utf8()
180 else if ((src[spos] & 0xdc00) == 0xdc00) { in utf16_to_utf8()
186 ADD_BYTE(0xe0 | src[spos]>>12); in utf16_to_utf8()
187 ADD_BYTE(0x80 | ((src[spos]>>6) & 0x3f)); in utf16_to_utf8()
188 ADD_BYTE(0x80 | (src[spos] & 0x3f)); in utf16_to_utf8()