Lines Matching full:wc
82 int wc, i, k; in utf8_mbtowc() local
117 wc = *s++ & ((1 << (7 - k)) - 1); in utf8_mbtowc()
121 wc = (wc << 6) | (*s++ & 0x3f); in utf8_mbtowc()
123 if (wc < (1 << (5 * k - 4))) in utf8_mbtowc()
126 *pwc = wc; in utf8_mbtowc()
132 uint32_t wc = wc1; in utf8_wctomb() local
136 if (wc < (1u << 7)) { in utf8_wctomb()
137 *s++ = wc; in utf8_wctomb()
140 else if (wc < (1u << 11)) { in utf8_wctomb()
141 *s++ = 0xc0 | (wc >> 6); in utf8_wctomb()
142 *s++ = 0x80 | (wc & 0x3f); in utf8_wctomb()
145 else if (wc < (1u << 16)) { in utf8_wctomb()
146 *s++ = 0xe0 | (wc >> 12); in utf8_wctomb()
147 *s++ = 0x80 | ((wc >> 6) & 0x3f); in utf8_wctomb()
148 *s++ = 0x80 | (wc & 0x3f); in utf8_wctomb()
151 else if (wc < (1u << 21)) { in utf8_wctomb()
152 *s++ = 0xf0 | (wc >> 18); in utf8_wctomb()
153 *s++ = 0x80 | ((wc >> 12) & 0x3f); in utf8_wctomb()
154 *s++ = 0x80 | ((wc >> 6) & 0x3f); in utf8_wctomb()
155 *s++ = 0x80 | (wc & 0x3f); in utf8_wctomb()
158 else if (wc < (1u << 26)) { in utf8_wctomb()
159 *s++ = 0xf8 | (wc >> 24); in utf8_wctomb()
160 *s++ = 0x80 | ((wc >> 18) & 0x3f); in utf8_wctomb()
161 *s++ = 0x80 | ((wc >> 12) & 0x3f); in utf8_wctomb()
162 *s++ = 0x80 | ((wc >> 6) & 0x3f); in utf8_wctomb()
163 *s++ = 0x80 | (wc & 0x3f); in utf8_wctomb()
166 else if (wc < (1u << 31)) { in utf8_wctomb()
167 *s++ = 0xfc | (wc >> 30); in utf8_wctomb()
168 *s++ = 0x80 | ((wc >> 24) & 0x3f); in utf8_wctomb()
169 *s++ = 0x80 | ((wc >> 18) & 0x3f); in utf8_wctomb()
170 *s++ = 0x80 | ((wc >> 12) & 0x3f); in utf8_wctomb()
171 *s++ = 0x80 | ((wc >> 6) & 0x3f); in utf8_wctomb()
172 *s++ = 0x80 | (wc & 0x3f); in utf8_wctomb()
186 int (*wctomb)(void *table, char *s, int wc);
195 int charset_wctomb(struct charset *charset, char *s, int wc) in charset_wctomb() argument
197 return (*charset->wctomb)(charset->map, s, wc); in charset_wctomb()
215 static int wctomb_utf8(void *map, char *s, int wc) in wctomb_utf8() argument
218 return utf8_wctomb(s, wc); in wctomb_utf8()
229 int wc; in mbtowc_ascii() local
234 wc = (uint8_t)*s; in mbtowc_ascii()
235 if (wc & ~0x7f) in mbtowc_ascii()
238 *pwc = wc; in mbtowc_ascii()
239 return wc ? 1 : 0; in mbtowc_ascii()
242 static int wctomb_ascii(void *map, char *s, int wc) in wctomb_ascii() argument
247 if (wc & ~0x7f) in wctomb_ascii()
249 *s = wc; in wctomb_ascii()
261 int wc; in mbtowc_iso1() local
266 wc = (uint8_t)*s; in mbtowc_iso1()
267 if (wc & ~0xff) in mbtowc_iso1()
270 *pwc = wc; in mbtowc_iso1()
271 return wc ? 1 : 0; in mbtowc_iso1()
274 static int wctomb_iso1(void *map, char *s, int wc) in wctomb_iso1() argument
279 if (wc & ~0xff) in wctomb_iso1()
281 *s = wc; in wctomb_iso1()
297 uint16_t wc; in mbtowc_8bit() local
301 wc = map->from[(uint8_t)*s]; in mbtowc_8bit()
302 if (wc == 0xffff) in mbtowc_8bit()
305 *pwc = (int)wc; in mbtowc_8bit()
306 return wc ? 1 : 0; in mbtowc_8bit()
365 uint16_t wc = wc1; in wctomb_8bit() local
380 i = map->to->first[HASH(wc)]; in wctomb_8bit()
382 if (map->from[i] == wc) { in wctomb_8bit()
393 if (map->from[i] == wc) { in wctomb_8bit()
489 int i, j, wc; in charset_convert() local
501 i = charset_mbtowc(charset1, &wc, from, fromlen); in charset_convert()
506 wc = '#'; in charset_convert()
509 j = charset_wctomb(charset2, p, wc); in charset_convert()