Lines Matching +full:0 +full:x110000
41 #define KICONV_UCS_COMBINE 0x1
42 #define KICONV_UCS_FROM_UTF8 0x2
43 #define KICONV_UCS_TO_UTF8 0x4
44 #define KICONV_UCS_FROM_LE 0x8
45 #define KICONV_UCS_TO_LE 0x10
46 #define KICONV_UCS_FROM_UTF16 0x20
47 #define KICONV_UCS_TO_UTF16 0x40
48 #define KICONV_UCS_UCS4 0x80
62 { NULL, 0, 0 }
99 dp->convtype = 0; in iconv_ucs_open()
103 for (i = 0; unicode_family[i].name; i++) { in iconv_ucs_open()
104 if (strcasecmp(from, unicode_family[i].name) == 0) in iconv_ucs_open()
106 if (strcasecmp(to, unicode_family[i].name) == 0) in iconv_ucs_open()
109 if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) in iconv_ucs_open()
116 if ((dp->convtype & KICONV_UCS_FROM_UTF8) == 0 && in iconv_ucs_open()
117 (dp->convtype & KICONV_UCS_FROM_LE) == 0) { in iconv_ucs_open()
120 if ((dp->convtype & KICONV_UCS_TO_UTF8) == 0 && in iconv_ucs_open()
121 (dp->convtype & KICONV_UCS_TO_LE) == 0) { in iconv_ucs_open()
141 return 0; in iconv_ucs_open()
162 return 0; in iconv_ucs_close()
171 int ret = 0, i; in iconv_ucs_conv()
179 return 0; in iconv_ucs_conv()
185 while (ir > 0 && or > 0) { in iconv_ucs_conv()
190 code = 0; in iconv_ucs_conv()
194 inlen = 0; in iconv_ucs_conv()
196 if (code == 0) { in iconv_ucs_conv()
207 if ((code >= 0xd800 && code < 0xe000) || code >= 0x110000 ) { in iconv_ucs_conv()
228 for (q = ucs, i = ucslen - 1 ; i >= 0 ; i--) in iconv_ucs_conv()
229 *q++ = (code >> (i << 3)) & 0xff; in iconv_ucs_conv()
254 if ((*q & 0xfc) == 0xd8) { in iconv_ucs_conv()
279 if ((*q & 0xfc) != 0xdc) { in iconv_ucs_conv()
298 code = (ucs[0] << 8) | ucs[1]; in iconv_ucs_conv()
307 outlen = 0; in iconv_ucs_conv()
345 if ((dp->convtype & KICONV_UCS_UCS4) == 0 || in iconv_ucs_conv()
346 (dp->convtype & KICONV_UCS_TO_UTF16) == 0) { in iconv_ucs_conv()
382 return (0); in iconv_ucs_init()
388 return (0); in iconv_ucs_done()
404 {0, 0}
412 size_t i, w = 0; in utf8_to_ucs4()
413 uint32_t ucs4 = 0; in utf8_to_ucs4()
418 if ((*src & 0x80) == 0) { in utf8_to_ucs4()
420 * leading 1 bit is "0" in utf8_to_ucs4()
421 * utf-8: 0xxxxxxx in utf8_to_ucs4()
422 * ucs-4: 00000000 00000000 00000000 0xxxxxxx in utf8_to_ucs4()
426 ucs4 = *src & 0x7f; in utf8_to_ucs4()
427 } else if ((*src & 0xe0) == 0xc0) { in utf8_to_ucs4()
435 ucs4 = *src & 0x1f; in utf8_to_ucs4()
436 } else if ((*src & 0xf0) == 0xe0) { in utf8_to_ucs4()
444 ucs4 = *src & 0x0f; in utf8_to_ucs4()
445 } else if ((*src & 0xf8) == 0xf0) { in utf8_to_ucs4()
453 ucs4 = *src & 0x07; in utf8_to_ucs4()
456 return (0); in utf8_to_ucs4()
460 return (0); in utf8_to_ucs4()
466 if ((*(src + i) & 0xc0) != 0x80) { in utf8_to_ucs4()
468 return (0); in utf8_to_ucs4()
472 ucs4 |= *(src + i) & 0x3f; in utf8_to_ucs4()
488 if (ucs4 < 0x80) { in ucs4_to_utf8()
490 lead = 0; /* "0" */ in ucs4_to_utf8()
491 } else if (ucs4 < 0x800) { in ucs4_to_utf8()
493 lead = 0xc0; /* "11" */ in ucs4_to_utf8()
494 } else if (ucs4 < 0x10000) { in ucs4_to_utf8()
496 lead = 0xe0; /* "111" */ in ucs4_to_utf8()
497 } else if (ucs4 < 0x200000) { in ucs4_to_utf8()
499 lead = 0xf0; /* "1111" */ in ucs4_to_utf8()
513 *(p + i) = (ucs4 & 0x3f) | 0x80; in ucs4_to_utf8()
526 return ((((code - 0x10000) << 6) & 0x3ff0000) | in encode_surrogate()
527 ((code - 0x10000) & 0x3ff) | 0xd800dc00); in encode_surrogate()
533 return ((((ucs[0] & 0x3) << 18) | (ucs[1] << 10) | in decode_surrogate()
534 ((ucs[2] & 0x3) << 8) | ucs[3]) + 0x10000); in decode_surrogate()