/* See LICENSE file for copyright and license details. */ #include "lib-common.h" static unsigned char yijing_hexagrams[] = { 0xC0, 0xEB, 0xCC, 0xE0, 0xC9, 0xC5, 0xD8, 0xCB, 0xC8, 0xF8, 0xE4, 0xF4, 0xFC, 0xFA, 0xE9, 0xD3, 0xCD, 0xF1, 0xDD, 0xF7, 0xE5, 0xFF, 0xD4, 0xE2, 0xD9, 0xD1, 0xD5, 0xF3, 0xE8, 0xC3, 0xDA, 0xD6, 0xEA, 0xDB, 0xF0, 0xDE, 0xF9, 0xEE, 0xD0, 0xEC, 0xC4, 0xEF, 0xFE, 0xE6, 0xFB, 0xDC, 0xC2, 0xC7, 0xE1, 0xDF, 0xF6, 0xFD, 0xF5, 0xE7, 0xF2, 0xCF, 0xCA, 0xED, 0xE3, 0xCE, 0xD2, 0xC6, 0xD7, 0xC1 }; enum libcharconv_result libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size_t *ncp) { enum libcharconv_result ret = LIBCHARCONV_CONVERTED; uint_least32_t c; char c1, c2, c3, c4, c5, c6; const char *cs; size_t i, clen; unsigned num; *n = 0; while (slen) { clen = libcharconv_decode_utf8_(s, slen, &c); if (clen > slen) { if (*n) goto no_conv; return LIBCHARCONV_INDETERMINATE; } if (!clen) { *n += 1u; slen -= 1u; s = &s[1]; continue; } slen -= clen; if (UINT32_C(0x2680) <= c && c <= UINT32_C(0x2685)) { /* dice */ c -= (uint_least32_t)UINT32_C(0x2680) - (uint_least32_t)'1'; goto conv; } else if (UINT32_C(0x1F1E6) <= c && c <= UINT32_C(0x1F1FF)) { /* region indicators */ c -= (uint_least32_t)UINT32_C(0x1F1E6) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0xE0020) <= c && c <= UINT32_C(0xE007E)) { /* tags */ c -= (uint_least32_t)UINT32_C(0xE0000); goto conv; } else if (UINT32_C(0x10800) <= c && c <= UINT32_C(0x1083F)) { /* cypriot */ c -= UINT32_C(0x10800); c1 = "_jklmnprstwxz"[c / 5]; c2 = "aeiou"[c % 5]; if (c1 == '_') { c = (uint_least32_t)c2; goto conv; } if (c1 == 'j' && c2 != 'a' && c2 != 'o') goto no_match; if (c1 == 'w' && c2 == 'u') goto no_match; if (c1 == 'x' && c2 != 'a' && c2 != 'e') goto no_match; if (c1 == 'z' && c2 != 'a' && c2 != 'o') goto no_match; goto conv2; } else if (UINT32_C(0x1D400) <= c && c <= UINT32_C(0x1D419)) { /* bold (captial) */ c -= (uint_least32_t)UINT32_C(0x1D400) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D41A) <= c && c <= UINT32_C(0x1D433)) { /* bold (small) */ c -= (uint_least32_t)UINT32_C(0x1D41A) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D7CE) <= c && c <= UINT32_C(0x1D7D7)) { /* bold (digit) */ c -= (uint_least32_t)UINT32_C(0x1D7CE) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x1D434) <= c && c <= UINT32_C(0x1D44D)) { /* italic (captial) */ c -= (uint_least32_t)UINT32_C(0x1D434) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D44E) <= c && c <= UINT32_C(0x1D467)) { /* italic (small) */ c -= (uint_least32_t)UINT32_C(0x1D44E) - (uint_least32_t)'a'; goto conv; } else if (c == UINT32_C(0x210E)) { /* italic (small h) */ c = (uint_least32_t)'h'; goto conv; } else if (UINT32_C(0x1D468) <= c && c <= UINT32_C(0x1D481)) { /* bold italic (captial) */ c -= (uint_least32_t)UINT32_C(0x1D468) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D482) <= c && c <= UINT32_C(0x1D49B)) { /* bold italic (small) */ c -= (uint_least32_t)UINT32_C(0x1D482) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D670) <= c && c <= UINT32_C(0x1D689)) { /* monospace (captial) */ c -= (uint_least32_t)UINT32_C(0x1D670) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D68A) <= c && c <= UINT32_C(0x1D6A3)) { /* monospace (small) */ c -= (uint_least32_t)UINT32_C(0x1D68A) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D7F6) <= c && c <= UINT32_C(0x1D7FF)) { /* monospace (digit) */ c -= (uint_least32_t)UINT32_C(0x1D7F6) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x1FBF0) <= c && c <= UINT32_C(0x1FBF9)) { /* segmented */ c -= (uint_least32_t)UINT32_C(0x1FBF0) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x1D5A0) <= c && c <= UINT32_C(0x1D5B9)) { /* sans-serif (captial) */ c -= (uint_least32_t)UINT32_C(0x1D5A0) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D5BA) <= c && c <= UINT32_C(0x1D5D3)) { /* sans-serif (small) */ c -= (uint_least32_t)UINT32_C(0x1D5BA) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D7E2) <= c && c <= UINT32_C(0x1D7EB)) { /* sans-serif (digit) */ c -= (uint_least32_t)UINT32_C(0x1D7E2) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x1D5D4) <= c && c <= UINT32_C(0x1D5ED)) { /* sans-serif bold (captial) */ c -= (uint_least32_t)UINT32_C(0x1D5D4) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D5EE) <= c && c <= UINT32_C(0x1D607)) { /* sans-serif bold (small) */ c -= (uint_least32_t)UINT32_C(0x1D5EE) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D7EC) <= c && c <= UINT32_C(0x1D7F5)) { /* sans-serif bold (digit) */ c -= (uint_least32_t)UINT32_C(0x1D7EC) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x1D608) <= c && c <= UINT32_C(0x1D621)) { /* sans-serif italic (captial) */ c -= (uint_least32_t)UINT32_C(0x1D608) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D622) <= c && c <= UINT32_C(0x1D63B)) { /* sans-serif italic (small) */ c -= (uint_least32_t)UINT32_C(0x1D622) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D63C) <= c && c <= UINT32_C(0x1D655)) { /* sans-serif bold italic (captial) */ c -= (uint_least32_t)UINT32_C(0x1D63C) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D656) <= c && c <= UINT32_C(0x1D66F)) { /* sans-serif bold italic (small) */ c -= (uint_least32_t)UINT32_C(0x1D656) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D538) <= c && c <= UINT32_C(0x1D551)) { /* double-struck (captial) */ c -= (uint_least32_t)UINT32_C(0x1D538) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D552) <= c && c <= UINT32_C(0x1D56B)) { /* double-struck (small) */ c -= (uint_least32_t)UINT32_C(0x1D552) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D7D8) <= c && c <= UINT32_C(0x1D7E1)) { /* double-struck (digit) */ c -= (uint_least32_t)UINT32_C(0x1D7D8) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x1D504) <= c && c <= UINT32_C(0x1D51D)) { /* fraktur (captial) */ c -= (uint_least32_t)UINT32_C(0x1D504) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D51E) <= c && c <= UINT32_C(0x1D537)) { /* fraktur (small) */ c -= (uint_least32_t)UINT32_C(0x1D51E) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D56C) <= c && c <= UINT32_C(0x1D585)) { /* bold fraktur (captial) */ c -= (uint_least32_t)UINT32_C(0x1D56C) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D586) <= c && c <= UINT32_C(0x1D59F)) { /* bold fraktur (small) */ c -= (uint_least32_t)UINT32_C(0x1D586) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D49C) <= c && c <= UINT32_C(0x1D4B5)) { /* script (captial) */ c -= (uint_least32_t)UINT32_C(0x1D49C) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D4B6) <= c && c <= UINT32_C(0x1D4CF)) { /* script (small) */ c -= (uint_least32_t)UINT32_C(0x1D4B6) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1D4D0) <= c && c <= UINT32_C(0x1D4E9)) { /* bold script (captial) */ c -= (uint_least32_t)UINT32_C(0x1D4D0) - (uint_least32_t)'A'; goto conv; } else if (UINT32_C(0x1D4EA) <= c && c <= UINT32_C(0x1D503)) { /* bold script (small) */ c -= (uint_least32_t)UINT32_C(0x1D4EA) - (uint_least32_t)'a'; goto conv; } else if (UINT32_C(0x1F110) <= c && c <= UINT32_C(0x1F129)) { /* bracketed (parenthesised capital) */ c -= (uint_least32_t)UINT32_C(0x1F110) - (uint_least32_t)'A'; c1 = '('; c2 = (char)c; c3 = ')'; goto conv3; } else if (UINT32_C(0x249C) <= c && c <= UINT32_C(0x24B5)) { /* bracketed (parenthesised small) */ c -= (uint_least32_t)UINT32_C(0x249C) - (uint_least32_t)'a'; c1 = '('; c2 = (char)c; c3 = ')'; goto conv3; } else if (UINT32_C(0x2474) <= c && c <= UINT32_C(0x247C)) { /* bracketed (parenthesised number) */ c -= (uint_least32_t)UINT32_C(0x2474) - (uint_least32_t)'1'; c1 = '('; c2 = (char)c; c3 = ')'; goto conv3; } else if (UINT32_C(0x247D) <= c && c <= UINT32_C(0x2486)) { /* bracketed (parenthesised number) */ c -= (uint_least32_t)UINT32_C(0x247D) - (uint_least32_t)'0'; c1 = '('; c2 = '1'; c3 = (char)c; c4 = ')'; goto conv4; } else if (c == UINT32_C(0x2487)) { /* bracketed (parenthesised number) */ c1 = '('; c2 = '2'; c3 = '0'; c4 = ')'; goto conv4; } else if (UINT32_C(0x1F101) <= c && c <= UINT32_C(0x1F10A)) { /* bracketed (number comma) */ c -= (uint_least32_t)UINT32_C(0x1F101) - (uint_least32_t)'0'; c1 = (char)c; c2 = ','; goto conv2; } else if (c == UINT32_C(0x1F100)) { /* bracketed (number full stop) */ c1 = '0'; c2 = '.'; goto conv2; } else if (UINT32_C(0x2488) <= c && c <= UINT32_C(0x2490)) { /* bracketed (number full stop) */ c -= (uint_least32_t)UINT32_C(0x2488) - (uint_least32_t)'1'; c1 = (char)c; c2 = '.'; goto conv2; } else if (UINT32_C(0x2491) <= c && c <= UINT32_C(0x249A)) { /* bracketed (number full stop) */ c -= (uint_least32_t)UINT32_C(0x2491) - (uint_least32_t)'0'; c1 = '1'; c2 = (char)c; c3 = '.'; goto conv3; } else if (c == UINT32_C(0x249B)) { /* bracketed (number full stop) */ c1 = '2'; c2 = '0'; c3 = '.'; goto conv3; } else if (UINT32_C(0xFE00) <= c && c <= UINT32_C(0xFE0F)) { /* variation selectors */ num = (unsigned)(c - UINT32_C(0xFE00)) + 1u; if (num < 10) { c1 = (char)('0' + num); goto conv1; } else { c1 = (char)('0' + num / 10); c2 = (char)('0' + num % 10); goto conv2; } } else if (UINT32_C(0xE0100) <= c && c <= UINT32_C(0xE01EF)) { /* variation selectors */ num = (unsigned)(c - UINT32_C(0xE0100)) + 17u; if (num < 100) { c1 = (char)('0' + num / 10); c2 = (char)('0' + num % 10); goto conv2; } else { c1 = (char)('0' + num / 100); c2 = (char)('0' + num / 10 % 10); c3 = (char)('0' + num % 10); goto conv3; } } else if (UINT32_C(0x2070) <= c && c <= UINT32_C(0x2079)) { /* superscript */ c -= (uint_least32_t)UINT32_C(0x2070) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x00B2) <= c && c <= UINT32_C(0x00B3)) { /* superscript */ c -= (uint_least32_t)UINT32_C(0x00B2) - (uint_least32_t)'2'; goto conv; } else if (c == UINT32_C(0x00B9)) { /* superscript */ c -= (uint_least32_t)UINT32_C(0x00B9) - (uint_least32_t)'1'; goto conv; } else if (UINT32_C(0x2080) <= c && c <= UINT32_C(0x2089)) { /* subscript */ c -= (uint_least32_t)UINT32_C(0x2080) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x10920) <= c && c <= UINT32_C(0x10939)) { /* lydian */ c = (uint_least32_t)"abgdeviyklmnorStufqsTAELNc"[c - UINT32_C(0x10920)]; goto conv; } else if (UINT32_C(0x10280) <= c && c <= UINT32_C(0x1029C)) { /* lycian */ c = (uint_least32_t)"aebBgdiwzDjkqlmnMNupKrstTAEhx"[c - UINT32_C(0x10280)]; goto conv; } else if (UINT32_C(0x1F031) <= c && c <= UINT32_C(0x1F061)) { /* domino tiles */ c1 = (char)(((uint_least32_t)c - UINT32_C(0x1F031)) / 7u + (unsigned)'0'); c3 = (char)(((uint_least32_t)c - UINT32_C(0x1F031)) % 7u + (unsigned)'0'); c2 = '|'; goto conv3; } else if (UINT32_C(0x1F063) <= c && c <= UINT32_C(0x1F093)) { /* domino tiles */ c1 = (char)(((uint_least32_t)c - UINT32_C(0x1F063)) / 7u + (unsigned)'0'); c3 = (char)(((uint_least32_t)c - UINT32_C(0x1F063)) % 7u + (unsigned)'0'); c2 = '-'; goto conv3; } else if (UINT32_C(0x1F550) <= c && c <= UINT32_C(0x1F567)) { /* clock faces */ c -= UINT32_C(0x1F550); c1 = (char)((c + 1u) % 12u / 10u + (uint_least32_t)'0'); c2 = (char)((c + 1u) % 12u % 10u + (uint_least32_t)'0'); c3 = ':'; c4 = c < 12u ? '0' : '3'; c5 = '0'; goto conv5; } else if (UINT32_C(0x2440) <= c && c <= UINT32_C(0x244A)) { /* ocr */ c = (uint_least32_t)"SdYAIXC/P_\\"[c - UINT32_C(0x2440)]; goto conv; } else if (UINT32_C(0x2800) <= c && c <= UINT32_C(0x28FF)) { /* braille */ if (*n) goto no_conv; *n += clen; i = 0u; if ((c & 0x01u) && *ncp > i) cp[i++] = '1'; if ((c & 0x02u) && *ncp > i) cp[i++] = '2'; if ((c & 0x04u) && *ncp > i) cp[i++] = '3'; if ((c & 0x08u) && *ncp > i) cp[i++] = '4'; if ((c & 0x10u) && *ncp > i) cp[i++] = '5'; if ((c & 0x20u) && *ncp > i) cp[i++] = '6'; if ((c & 0x40u) && *ncp > i) cp[i++] = '7'; if ((c & 0x80u) && *ncp > i) cp[i++] = '8'; if (*ncp > i) cp[i++] = '0'; *ncp = i; return ret; } else if (UINT32_C(0xA4D0) <= c && c <= UINT32_C(0xA4FF)) { /* lisu */ c1 = "bpPdtYgkKjcCzfFmnlsrRVvhGJwxyBaAeEiouULD., ;:-="[c - UINT32_C(0xA4D0)]; if (c1 == ' ') goto use_switch; goto conv1; } else if (UINT32_C(0x2630) <= c && c <= UINT32_C(0x2637)) { /* yijing trigrams */ c1 = (c & 1u) ? '2' : '1'; c2 = (c & 2u) ? '2' : '1'; c3 = (c & 4u) ? '2' : '1'; goto conv3; } else if (UINT32_C(0x1D306) <= c && c <= UINT32_C(0x1D356)) { /* yijing tetragrams */ c -= UINT32_C(0x1D306); c4 = (char)((c % 3u) + (unsigned)'1'); c /= 3u; c3 = (char)((c % 3u) + (unsigned)'1'); c /= 3u; c2 = (char)((c % 3u) + (unsigned)'1'); c /= 3u; c1 = (char)((c % 3u) + (unsigned)'1'); goto conv4; } else if (UINT32_C(0x4DC0) <= c && c <= UINT32_C(0x4DFF)) { /* yijing hexagrams */ c &= 0xFFu; for (i = 0u;; i++) if (yijing_hexagrams[i] == (unsigned char)c) break; c6 = (i & 1u) ? '2' : '1'; c5 = (i & 2u) ? '2' : '1'; c4 = (i & 4u) ? '2' : '1'; c3 = (i & 8u) ? '2' : '1'; c2 = (i & 16u) ? '2' : '1'; c1 = (i & 32u) ? '2' : '1'; goto conv6; } else if (UINT32_C(0x110D0) <= c && c <= UINT32_C(0x110E8)) { /* sora sompeng */ c = (uint_least32_t)"stbcdgmGlnvpyrhkjYaEiuoeM"[c - UINT32_C(0x110D0)]; goto conv; } else if (UINT32_C(0x110F0) <= c && c <= UINT32_C(0x110F9)) { /* sora sompeng */ c -= (uint_least32_t)UINT32_C(0x110F0) - (uint_least32_t)'0'; goto conv; } else if (UINT32_C(0x1FA60) <= c && c <= UINT32_C(0x1FA6D)) { /* xiangqi */ c = (uint_least32_t)"gaehrcsGAEHRCS"[c - UINT32_C(0x1FA60)]; goto conv; } else if (UINT32_C(0x2400) <= c && c <= UINT32_C(0x2421)) { /* control character representations */ cs = ((const char *[]){ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", " VT", "FF", "CR", "SS", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US", "SP", "DEL" })[c & 0xFF]; goto conv_str; } else if (UINT32_C(0x2654) <= c && c <= UINT32_C(0x265F)) { /* chess */ c = (uint_least32_t)"kqrbnpKQRBNP"[c - UINT32_C(0x2654)]; goto conv; } else if (UINT32_C(0x1FA00) <= c && c <= UINT32_C(0x1FA47)) { /* chess */ c = (uint_least32_t)"kqrbnpnNnkqrbnpKQRBNP"[(c - UINT32_C(0x1FA00)) % 21u]; goto conv; } else if (UINT32_C(0x1FA48) <= c && c <= UINT32_C(0x1FA4D)) { /* chess */ c = (uint_least32_t)"eEe"[(c - UINT32_C(0x1FA48)) % 3u]; goto conv; } else if (UINT32_C(0x2460) <= c && c <= UINT32_C(0x2468)) { /* enclosed (positive) */ c1 = '('; c2 = (char)(c - (UINT32_C(0x2460) - (uint_least32_t)'1')); c3 = ')'; goto conv3; } else if (UINT32_C(0x2469) <= c && c <= UINT32_C(0x2472)) { /* enclosed (positive) */ c1 = '('; c2 = '1'; c3 = (char)(c - (UINT32_C(0x2469) - (uint_least32_t)'0')); c4 = ')'; goto conv4; } else if (UINT32_C(0x24D0) <= c && c <= UINT32_C(0x24E9)) { /* enclosed (positive) */ c1 = '('; c2 = (char)(c - (UINT32_C(0x24D0) - (uint_least32_t)'a')); c3 = ')'; goto conv3; } else if (UINT32_C(0x24B6) <= c && c <= UINT32_C(0x24CF)) { /* enclosed (positive) */ c1 = '('; c2 = (char)(c - (UINT32_C(0x24B6) - (uint_least32_t)'A')); c3 = ')'; goto conv3; } else if (UINT32_C(0x1F130) <= c && c <= UINT32_C(0x1F149)) { /* enclosed (positive) */ c1 = '['; c2 = (char)(c - (UINT32_C(0x1F130) - (uint_least32_t)'A')); c3 = ']'; goto conv3; } else if (UINT32_C(0x2780) <= c && c <= UINT32_C(0x2788)) { /* enclosed (positive) */ c1 = '('; c2 = (char)(c - (UINT32_C(0x2780) - (uint_least32_t)'1')); c3 = ')'; goto conv3; } else if (UINT32_C(0x24F5) <= c && c <= UINT32_C(0x24FD)) { /* enclosed (positive) */ c1 = '('; c2 = '('; c3 = (char)(c - (UINT32_C(0x24F5) - (uint_least32_t)'1')); c4 = ')'; c5 = ')'; goto conv5; } else if (UINT32_C(0x2776) <= c && c <= UINT32_C(0x277E)) { /* enclosed (negative) */ c1 = '('; c2 = (char)(c - (UINT32_C(0x2776) - (uint_least32_t)'1')); c3 = ')'; goto conv3; } else if (UINT32_C(0x24EB) <= c && c <= UINT32_C(0x24F3)) { /* enclosed (negative) */ c1 = '('; c2 = '1'; c3 = (char)(c - (UINT32_C(0x24EB) - (uint_least32_t)'1')); c4 = ')'; goto conv4; } else if (UINT32_C(0x1F150) <= c && c <= UINT32_C(0x1F169)) { /* enclosed (negative) */ c1 = '('; c2 = (char)(c - (UINT32_C(0x1F150) - (uint_least32_t)'A')); c3 = ')'; goto conv3; } else if (UINT32_C(0x1F170) <= c && c <= UINT32_C(0x1F189)) { /* enclosed (negative) */ c1 = '['; c2 = (char)(c - (UINT32_C(0x1F170) - (uint_least32_t)'A')); c3 = ']'; goto conv3; } else if (UINT32_C(0x278A) <= c && c <= UINT32_C(0x2792)) { /* enclosed (negative) */ c1 = '('; c2 = (char)(c - (UINT32_C(0x278A) - (uint_least32_t)'1')); c3 = ')'; goto conv3; } else if (UINT32_C(0x23D6) <= c && c <= UINT32_C(0x23D9)) { /* metrical */ c -= (uint_least32_t)UINT32_C(0x23D6) - (uint_least32_t)'2'; goto conv; } else if (UINT32_C(0x23D2) <= c && c <= UINT32_C(0x23D5)) { /* metrical */ c -= (uint_least32_t)UINT32_C(0x23D2); c1 = (c & 1u) ? '_' : '-'; c2 = (c & 2u) ? '2' : '1'; goto conv2; } else { use_switch: switch (c) { /* shogi */ case UINT32_C(0x2616): c = (uint_least32_t)'w'; goto conv; case UINT32_C(0x2617): c = (uint_least32_t)'b'; goto conv; case UINT32_C(0x26C9): c = (uint_least32_t)'W'; goto conv; case UINT32_C(0x26CA): c = (uint_least32_t)'B'; goto conv; /* go (common) */ case UINT32_C(0x25CF): c = (uint_least32_t)'b'; goto conv; case UINT32_C(0x25CB): c = (uint_least32_t)'w'; goto conv; /* go (white) */ case UINT32_C(0x2686): c = (uint_least32_t)'1'; goto conv; case UINT32_C(0x2687): c = (uint_least32_t)'2'; goto conv; /* go (black) */ case UINT32_C(0x2688): c = (uint_least32_t)'1'; goto conv; case UINT32_C(0x2689): c = (uint_least32_t)'2'; goto conv; /* draughts */ case UINT32_C(0x26C0): c = (uint_least32_t)'m'; goto conv; case UINT32_C(0x26C1): c = (uint_least32_t)'k'; goto conv; case UINT32_C(0x26C2): c = (uint_least32_t)'M'; goto conv; case UINT32_C(0x26C3): c = (uint_least32_t)'K'; goto conv; /* gender symbols */ case UINT32_C(0x2640): c = (uint_least32_t)'f'; goto conv; case UINT32_C(0x2642): c = (uint_least32_t)'m'; goto conv; case UINT32_C(0x263F): c = (uint_least32_t)'i'; goto conv; /* double-struck */ case UINT32_C(0x2102): c = (uint_least32_t)'C'; goto conv; case UINT32_C(0x210D): c = (uint_least32_t)'H'; goto conv; case UINT32_C(0x2115): c = (uint_least32_t)'N'; goto conv; case UINT32_C(0x2119): c = (uint_least32_t)'P'; goto conv; case UINT32_C(0x211A): c = (uint_least32_t)'Q'; goto conv; case UINT32_C(0x211D): c = (uint_least32_t)'R'; goto conv; case UINT32_C(0x2124): c = (uint_least32_t)'Z'; goto conv; /* double-struck italic */ case UINT32_C(0x2145): c = (uint_least32_t)'D'; goto conv; case UINT32_C(0x2146): c = (uint_least32_t)'d'; goto conv; case UINT32_C(0x2147): c = (uint_least32_t)'e'; goto conv; case UINT32_C(0x2148): c = (uint_least32_t)'i'; goto conv; case UINT32_C(0x2149): c = (uint_least32_t)'j'; goto conv; /* fraktur */ case UINT32_C(0x212D): c = (uint_least32_t)'C'; goto conv; case UINT32_C(0x210C): c = (uint_least32_t)'H'; goto conv; case UINT32_C(0x2111): c = (uint_least32_t)'I'; goto conv; case UINT32_C(0x211C): c = (uint_least32_t)'R'; goto conv; case UINT32_C(0x2128): c = (uint_least32_t)'Z'; goto conv; /* script */ case UINT32_C(0x212C): c = (uint_least32_t)'B'; goto conv; case UINT32_C(0x2130): c = (uint_least32_t)'E'; goto conv; case UINT32_C(0x2131): c = (uint_least32_t)'F'; goto conv; case UINT32_C(0x210B): c = (uint_least32_t)'H'; goto conv; case UINT32_C(0x2110): c = (uint_least32_t)'I'; goto conv; case UINT32_C(0x2112): c = (uint_least32_t)'L'; goto conv; case UINT32_C(0x2133): c = (uint_least32_t)'M'; goto conv; case UINT32_C(0x211B): c = (uint_least32_t)'R'; goto conv; case UINT32_C(0x212F): c = (uint_least32_t)'e'; goto conv; case UINT32_C(0x210A): c = (uint_least32_t)'g'; goto conv; case UINT32_C(0x2134): c = (uint_least32_t)'o'; goto conv; /* buhid */ case UINT32_C(0x1740): c = (uint_least32_t)'a'; goto conv; case UINT32_C(0x1741): c = (uint_least32_t)'i'; goto conv; case UINT32_C(0x1742): c = (uint_least32_t)'u'; goto conv; case UINT32_C(0x1752): c2 = 'i'; goto budih_combining; case UINT32_C(0x1753): c2 = 'u'; goto budih_combining; budih_combining: c1 = '^'; goto conv2; case UINT32_C(0x174A): c1 = 'b'; goto budih; case UINT32_C(0x1747): c1 = 'd'; goto budih; case UINT32_C(0x1744): c1 = 'g'; goto budih; case UINT32_C(0x1751): c1 = 'h'; goto budih; case UINT32_C(0x1743): c1 = 'k'; goto budih; case UINT32_C(0x174E): c1 = 'l'; goto budih; case UINT32_C(0x174B): c1 = 'm'; goto budih; case UINT32_C(0x1748): c1 = 'n'; goto budih; case UINT32_C(0x1749): c1 = 'p'; goto budih; case UINT32_C(0x174D): c1 = 'r'; goto budih; case UINT32_C(0x1750): c1 = 's'; goto budih; case UINT32_C(0x1746): c1 = 't'; goto budih; case UINT32_C(0x174C): c1 = 'y'; goto budih; case UINT32_C(0x174F): c1 = 'w'; goto budih; case UINT32_C(0x1745): c1 = '-'; goto budih; budih: if (*n) goto no_conv; c2 = 'a'; s = &s[clen]; *n += clen; if (!slen) { ret = LIBCHARCONV_CONVERT_IF_END; goto budih_conv; } clen = libcharconv_decode_utf8_(s, slen, &c); if (clen > slen) return LIBCHARCONV_INDETERMINATE; if (!clen) goto budih_conv; switch (c) { case UINT32_C(0x1752): c2 = 'i'; *n += clen; break; case UINT32_C(0x1753): c2 = 'u'; *n += clen; break; default: break; } budih_conv: if (c1 == '-') { c3 = c2; c2 = 'g'; c1 = 'n'; goto conv3_prechecked; } goto conv2_prechecked; /* replacement */ case UINT32_C(0xFFFC): c1 = 'o'; c2 = 'b'; c3 = 'j'; goto conv3; case UINT32_C(0xFFFD): c = (uint_least32_t)'?'; goto conv; /* lydian */ case UINT32_C(0x1093F): c = (uint_least32_t)'"'; goto conv; /* domino tiles */ case UINT32_C(0x1F030): c1 = '#'; c2 = '|'; c3 = '#'; goto conv3; case UINT32_C(0x1F062): c1 = '#'; c2 = '-'; c3 = '#'; goto conv3; /* ocr (telegraphing) */ case UINT32_C(0x2BFF): c1 = 'E'; goto conv1; /* crop marks */ case UINT32_C(0x230C): c1 = '|'; c2 = '-'; goto conv2; case UINT32_C(0x230D): c1 = '-'; c2 = '|'; goto conv2; case UINT32_C(0x230E): c1 = '|'; c2 = '_'; goto conv2; case UINT32_C(0x230F): c1 = '_'; c2 = '|'; goto conv2; /* lisu */ case UINT32_C(0xA4FB): c1 = '.'; c2 = ','; goto conv2; case UINT32_C(0xA4FA): c1 = '.'; c2 = '.'; goto conv2; case UINT32_C(0x11FB0): c1 = 'Y'; goto conv1; /* yijing monograms */ case UINT32_C(0x268A): c1 = '1'; goto conv1; case UINT32_C(0x268B): c1 = '2'; goto conv1; case UINT32_C(0x1D300): c1 = '3'; goto conv1; /* yijing digrams */ case UINT32_C(0x268C): c1 = '1'; c2 = '1'; goto conv2; case UINT32_C(0x268E): c1 = '1'; c2 = '2'; goto conv2; case UINT32_C(0x1D301): c1 = '1'; c2 = '3'; goto conv2; case UINT32_C(0x268D): c1 = '2'; c2 = '1'; goto conv2; case UINT32_C(0x268F): c1 = '2'; c2 = '2'; goto conv2; case UINT32_C(0x1D302): c1 = '2'; c2 = '3'; goto conv2; case UINT32_C(0x1D303): c1 = '3'; c2 = '1'; goto conv2; case UINT32_C(0x1D304): c1 = '3'; c2 = '2'; goto conv2; case UINT32_C(0x1D305): c1 = '3'; c2 = '3'; goto conv2; /* vulgar fractions */ case UINT32_C(0x2044): c1 = '/'; goto conv1; case UINT32_C(0x215F): c1 = '1'; c2 = '/'; goto conv2; case UINT32_C(0x2189): c1 = '0'; c2 = '/'; c3 = '3'; goto conv3; case UINT32_C(0x00BD): c1 = '1'; c2 = '/'; c3 = '2'; goto conv3; case UINT32_C(0x2153): c1 = '1'; c2 = '/'; c3 = '3'; goto conv3; case UINT32_C(0x00BC): c1 = '1'; c2 = '/'; c3 = '4'; goto conv3; case UINT32_C(0x2155): c1 = '1'; c2 = '/'; c3 = '5'; goto conv3; case UINT32_C(0x2159): c1 = '1'; c2 = '/'; c3 = '6'; goto conv3; case UINT32_C(0x2150): c1 = '1'; c2 = '/'; c3 = '7'; goto conv3; case UINT32_C(0x215B): c1 = '1'; c2 = '/'; c3 = '8'; goto conv3; case UINT32_C(0x2151): c1 = '1'; c2 = '/'; c3 = '9'; goto conv3; case UINT32_C(0x2154): c1 = '2'; c2 = '/'; c3 = '3'; goto conv3; case UINT32_C(0x2156): c1 = '2'; c2 = '/'; c3 = '5'; goto conv3; case UINT32_C(0x00BE): c1 = '3'; c2 = '/'; c3 = '4'; goto conv3; case UINT32_C(0x2157): c1 = '3'; c2 = '/'; c3 = '5'; goto conv3; case UINT32_C(0x215C): c1 = '3'; c2 = '/'; c3 = '8'; goto conv3; case UINT32_C(0x2158): c1 = '4'; c2 = '/'; c3 = '5'; goto conv3; case UINT32_C(0x215A): c1 = '5'; c2 = '/'; c3 = '6'; goto conv3; case UINT32_C(0x215D): c1 = '5'; c2 = '/'; c3 = '8'; goto conv3; case UINT32_C(0x215E): c1 = '7'; c2 = '/'; c3 = '8'; goto conv3; case UINT32_C(0x2152): c1 = '1'; c2 = '/'; c3 = '1'; c4 = '0'; goto conv4; /* overlaid */ case UINT32_C(0x203D): case UINT32_C(0x2E18): c1 = '!'; c2 = '?'; goto conv2; case UINT32_C(0x1FA4E): c1 = 'n'; c2 = 'q'; goto conv2; case UINT32_C(0x1FA4F): c1 = 'n'; c2 = 'r'; goto conv2; case UINT32_C(0x1FA50): c1 = 'n'; c2 = 'b'; goto conv2; case UINT32_C(0x1FA51): c1 = 'N'; c2 = 'Q'; goto conv2; case UINT32_C(0x1FA52): c1 = 'N'; c2 = 'R'; goto conv2; case UINT32_C(0x1FA53): c1 = 'N'; c2 = 'B'; goto conv2; /* joined */ case UINT32_C(0x2048): c1 = '?'; c2 = '!'; goto conv2; case UINT32_C(0x2047): c1 = '?'; c2 = '?'; goto conv2; case UINT32_C(0x203C): c1 = '!'; c2 = '!'; goto conv2; case UINT32_C(0x2049): c1 = '!'; c2 = '?'; goto conv2; /* mirrored */ case UINT32_C(0x204F): c = UINT32_C(0x003B); goto conv; case UINT32_C(0x2E2E): c = UINT32_C(0x003F); goto conv; case UINT32_C(0x2143): c = UINT32_C(0x004C); goto conv; /* turned */ case UINT32_C(0x218A): c = UINT32_C(0x0032); goto conv; case UINT32_C(0x218B): c = UINT32_C(0x0033); goto conv; case UINT32_C(0x00A1): c = UINT32_C(0x0021); goto conv; case UINT32_C(0x00BF): c = UINT32_C(0x003F); goto conv; case UINT32_C(0x2E35): c = UINT32_C(0x003B); goto conv; case UINT32_C(0x1F12F): c1 = '('; c2 = 'C'; c3 = ')'; goto conv3; /* tally marks */ case UINT32_C(0x13D77): c1 = '1'; goto conv1; case UINT32_C(0x13D78): c1 = '5'; goto conv1; /* ideographic tally marks */ case UINT32_C(0x13D72): c1 = '1'; goto conv1; case UINT32_C(0x13D73): c1 = '2'; goto conv1; case UINT32_C(0x13D74): c1 = '3'; goto conv1; case UINT32_C(0x13D75): c1 = '4'; goto conv1; case UINT32_C(0x13D76): c1 = '5'; goto conv1; /* symbols */ case UINT32_C(0x269E): c1 = '-'; c2 = '>'; goto conv2; case UINT32_C(0x269F): c1 = '<'; c2 = '-'; goto conv2; case UINT32_C(0x2120): c1 = 'S'; c2 = 'M'; goto conv2; case UINT32_C(0x2122): c1 = 'T'; c2 = 'M'; goto conv2; case UINT32_C(0x00A9): c1 = '('; c2 = 'C'; c3 = ')'; goto conv3; case UINT32_C(0x1F1AD): c1 = '('; c2 = 'M'; c3 = ')'; goto conv3; case UINT32_C(0x2117): c1 = '('; c2 = 'P'; c3 = ')'; goto conv3; case UINT32_C(0x00AE): c1 = '('; c2 = 'R'; c3 = ')'; goto conv3; case UINT32_C(0x1F10D): c1 = '('; c2 = '0'; c3 = ')'; goto conv3; case UINT32_C(0x1F10F): c1 = '\\'; c2 = '('; c3 = '$'; c4 = ')'; goto conv4; case UINT32_C(0x1F16E): c1 = '\\'; c2 = '('; c3 = 'C'; c4 = ')'; goto conv4; case UINT32_C(0x1F16D): c1 = '('; c2 = 'C'; c3 = 'C'; c4 = ')'; goto conv4; case UINT32_C(0x212E): c1 = 'e'; goto conv1; case UINT32_C(0x2139): c1 = 'i'; goto conv1; case UINT32_C(0x212A): c1 = 'K'; goto conv1; case UINT32_C(0x213B): c1 = 'F'; c2 = 'A'; c3 = 'X'; goto conv3; case UINT32_C(0x2121): c1 = 'T'; c2 = 'E'; c3 = 'L'; goto conv3; case UINT32_C(0x2100): c1 = 'a'; c2 = '/'; c3 = 'c'; goto conv3; case UINT32_C(0x214D): c1 = 'A'; c2 = '/'; c3 = 'S'; goto conv3; case UINT32_C(0x2101): c1 = 'a'; c2 = '/'; c3 = 's'; goto conv3; case UINT32_C(0x00AA): c1 = 'a'; goto conv1; case UINT32_C(0x00BA): c1 = 'o'; goto conv1; case UINT32_C(0x2300): c1 = '/'; c2 = 'o'; goto conv2; case UINT32_C(0x2116): c1 = 'N'; c2 = 'o'; goto conv2; case UINT32_C(0x2118): c1 = 'P'; goto conv1; case UINT32_C(0x214A): c1 = 'P'; c2 = 'L'; goto conv2; case UINT32_C(0x211E): c1 = 'P'; c2 = 'x'; goto conv2; case UINT32_C(0x211F): c1 = 'R'; c2 = '/'; goto conv2; case UINT32_C(0x2123): c1 = 'V'; c2 = '/'; goto conv2; case UINT32_C(0x2125): c1 = 'z'; goto conv1; case UINT32_C(0x23E8): c1 = '1'; c2 = '0'; goto conv2; case UINT32_C(0x2104): c1 = 'C'; c2 = 'L'; goto conv2; case UINT32_C(0x2105): c1 = 'c'; c2 = '/'; c3 = 'o'; goto conv3; case UINT32_C(0x2106): c1 = 'c'; c2 = '/'; c3 = 'u'; goto conv3; case UINT32_C(0x2113): c1 = 'l'; goto conv1; case UINT32_C(0x2114): c1 = 'l'; c2 = 'b'; goto conv2; case UINT32_C(0x1F19B): c1 = '['; c2 = '3'; c3 = 'D'; c4 = ']'; goto conv4; case UINT32_C(0x1F19C): cs = "[2ND SCR]"; goto conv_str; case UINT32_C(0x1F1A7): c1 = '['; c2 = 'H'; c3 = 'D'; c4 = 'R'; c5 = ']'; goto conv5; case UINT32_C(0x1F1A6): c1 = '['; c2 = 'H'; c3 = 'C'; c4 = ']'; goto conv4; case UINT32_C(0x1F1AC): c1 = '['; c2 = 'V'; c3 = 'O'; c4 = 'D'; c5 = ']'; goto conv5; case UINT32_C(0x1F1A3): c1 = '['; c2 = '6'; c3 = '0'; c4 = 'P'; c5 = ']'; goto conv5; case UINT32_C(0x1F1A8): cs = "[HI-RES]"; goto conv_str; case UINT32_C(0x1F1A4): c1 = '['; c2 = '1'; c3 = '2'; c4 = '0'; c5 = 'P'; c6 = ']'; goto conv6; case UINT32_C(0x1F19D): c1 = '['; c2 = '2'; c3 = 'K'; c4 = ']'; goto conv4; case UINT32_C(0x1F19E): c1 = '['; c2 = '4'; c3 = 'K'; c4 = ']'; goto conv4; case UINT32_C(0x1F19F): c1 = '['; c2 = '8'; c3 = 'K'; c4 = ']'; goto conv4; case UINT32_C(0x1F1AB): c1 = '['; c2 = 'U'; c3 = 'H'; c4 = 'D'; c5 = ']'; goto conv5; case UINT32_C(0x1F1AA): c1 = '['; c2 = 'S'; c3 = 'H'; c4 = 'V'; c5 = ']'; goto conv5; case UINT32_C(0x1F1A9): cs = "[LOSSLESS]"; goto conv_str; case UINT32_C(0x1F1A0): c1 = '['; c2 = '5'; c3 = '.'; c4 = '1'; c5 = ']'; goto conv5; case UINT32_C(0x1F1A1): c1 = '['; c2 = '7'; c3 = '.'; c4 = '1'; c5 = ']'; goto conv5; case UINT32_C(0x1F1A2): c1 = '['; c2 = '2'; c3 = '2'; c4 = '.'; c5 = '2'; c6 = ']'; goto conv6; case UINT32_C(0x2141): c1 = 'G'; goto conv1; case UINT32_C(0x2142): c1 = 'L'; goto conv1; case UINT32_C(0x2144): c1 = 'Y'; goto conv1; /* control characters (control characters) */ case UINT32_C(0x00): c1 = 'N'; c2 = 'U'; c3 = 'L'; goto conv3; case UINT32_C(0x01): c1 = 'S'; c2 = 'O'; c3 = 'H'; goto conv3; case UINT32_C(0x02): c1 = 'S'; c2 = 'T'; c3 = 'X'; goto conv3; case UINT32_C(0x03): c1 = 'E'; c2 = 'T'; c3 = 'X'; goto conv3; case UINT32_C(0x04): c1 = 'E'; c2 = 'O'; c3 = 'T'; goto conv3; case UINT32_C(0x05): c1 = 'E'; c2 = 'N'; c3 = 'Q'; goto conv3; case UINT32_C(0x06): c1 = 'A'; c2 = 'C'; c3 = 'K'; goto conv3; case UINT32_C(0x07): c1 = 'B'; c2 = 'E'; c3 = 'L'; goto conv3; case UINT32_C(0x08): c1 = 'B'; c2 = 'S'; goto conv2; case UINT32_C(0x09): c1 = 'H'; c2 = 'T'; goto conv2; /* case UINT32_C(0x0A): c1 = 'L'; c2 = 'F'; goto conv2; */ case UINT32_C(0x0B): c1 = 'V'; c2 = 'T'; goto conv2; case UINT32_C(0x0C): c1 = 'F'; c2 = 'F'; goto conv2; case UINT32_C(0x0D): c1 = 'C'; c2 = 'R'; goto conv2; case UINT32_C(0x0E): c1 = 'S'; c2 = 'S'; goto conv2; case UINT32_C(0x0F): c1 = 'S'; c2 = 'I'; goto conv2; case UINT32_C(0x10): c1 = 'D'; c2 = 'L'; c3 = 'E'; goto conv3; case UINT32_C(0x11): c1 = 'D'; c2 = 'C'; c3 = '1'; goto conv3; case UINT32_C(0x12): c1 = 'D'; c2 = 'C'; c3 = '2'; goto conv3; case UINT32_C(0x13): c1 = 'D'; c2 = 'C'; c3 = '3'; goto conv3; case UINT32_C(0x14): c1 = 'D'; c2 = 'C'; c3 = '4'; goto conv3; case UINT32_C(0x15): c1 = 'N'; c2 = 'A'; c3 = 'K'; goto conv3; case UINT32_C(0x16): c1 = 'S'; c2 = 'Y'; c3 = 'N'; goto conv3; case UINT32_C(0x17): c1 = 'E'; c2 = 'T'; c3 = 'B'; goto conv3; case UINT32_C(0x18): c1 = 'C'; c2 = 'A'; c3 = 'N'; goto conv3; case UINT32_C(0x19): c1 = 'E'; c2 = 'M'; goto conv2; case UINT32_C(0x1A): c1 = 'S'; c2 = 'U'; c3 = 'B'; goto conv3; case UINT32_C(0x1B): c1 = 'E'; c2 = 'S'; c3 = 'C'; goto conv3; case UINT32_C(0x1C): c1 = 'F'; c2 = 'S'; goto conv2; case UINT32_C(0x1D): c1 = 'G'; c2 = 'S'; goto conv2; case UINT32_C(0x1E): c1 = 'R'; c2 = 'S'; goto conv2; case UINT32_C(0x1F): c1 = 'U'; c2 = 'S'; goto conv2; case UINT32_C(0x7F): c1 = 'D'; c2 = 'E'; c3 = 'L'; goto conv3; case UINT32_C(0x0080): c1 = 'P'; c2 = 'A'; c3 = 'D'; goto conv3; case UINT32_C(0x0081): c1 = 'H'; c2 = 'O'; c3 = 'P'; goto conv3; case UINT32_C(0x0082): c1 = 'B'; c2 = 'P'; c3 = 'H'; goto conv3; case UINT32_C(0x0083): c1 = 'N'; c2 = 'B'; c3 = 'P'; goto conv3; case UINT32_C(0x0084): c1 = 'I'; c2 = 'N'; c3 = 'D'; goto conv3; case UINT32_C(0x0085): c1 = 'N'; c2 = 'E'; c3 = 'L'; goto conv3; case UINT32_C(0x0086): c1 = 'S'; c2 = 'S'; c3 = 'A'; goto conv3; case UINT32_C(0x0087): c1 = 'E'; c2 = 'S'; c3 = 'A'; goto conv3; case UINT32_C(0x0088): c1 = 'H'; c2 = 'T'; c3 = 'S'; goto conv3; case UINT32_C(0x0089): c1 = 'H'; c2 = 'T'; c3 = 'J'; goto conv3; case UINT32_C(0x008A): c1 = 'L'; c2 = 'T'; c3 = 'S'; goto conv3; case UINT32_C(0x008B): c1 = 'P'; c2 = 'L'; c3 = 'D'; goto conv3; case UINT32_C(0x008C): c1 = 'P'; c2 = 'L'; c3 = 'U'; goto conv3; case UINT32_C(0x008D): c1 = 'R'; c2 = 'I'; goto conv2; case UINT32_C(0x008E): c1 = 'S'; c2 = 'S'; c3 = '2'; goto conv3; case UINT32_C(0x008F): c1 = 'S'; c2 = 'S'; c3 = '3'; goto conv3; case UINT32_C(0x0090): c1 = 'D'; c2 = 'C'; c3 = 'S'; goto conv3; case UINT32_C(0x0091): c1 = 'P'; c2 = 'U'; c3 = '1'; goto conv3; case UINT32_C(0x0092): c1 = 'P'; c2 = 'U'; c3 = '2'; goto conv3; case UINT32_C(0x0093): c1 = 'S'; c2 = 'T'; c3 = 'S'; goto conv3; case UINT32_C(0x0094): c1 = 'C'; c2 = 'C'; c3 = 'H'; goto conv3; case UINT32_C(0x0095): c1 = 'M'; c2 = 'W'; goto conv2; case UINT32_C(0x0096): c1 = 'S'; c2 = 'P'; c3 = 'A'; goto conv3; case UINT32_C(0x0097): c1 = 'E'; c2 = 'P'; c3 = 'A'; goto conv3; case UINT32_C(0x0098): c1 = 'S'; c2 = 'O'; c3 = 'S'; goto conv3; case UINT32_C(0x0099): c1 = 'S'; c2 = 'G'; c3 = 'C'; c4 = 'I'; goto conv4; case UINT32_C(0x009A): c1 = 'S'; c2 = 'S'; c3 = 'I'; goto conv3; case UINT32_C(0x009B): c1 = 'C'; c2 = 'S'; c3 = 'I'; goto conv3; case UINT32_C(0x009C): c1 = 'S'; c2 = 'T'; goto conv2; case UINT32_C(0x009D): c1 = 'O'; c2 = 'S'; c3 = 'C'; goto conv3; case UINT32_C(0x009E): c1 = 'P'; c2 = 'M'; goto conv2; case UINT32_C(0x009F): c1 = 'A'; c2 = 'P'; c3 = 'C'; goto conv3; case UINT32_C(0x200B): c1 = 'Z'; c2 = 'W'; c3 = 'S'; goto conv3; case UINT32_C(0x200C): c1 = 'Z'; c2 = 'W'; c3 = 'N'; c4 = 'J'; goto conv4; case UINT32_C(0x200D): c1 = 'Z'; c2 = 'W'; c3 = 'J'; goto conv3; case UINT32_C(0x200E): c1 = 'L'; c2 = 'T'; c3 = 'R'; c4 = 'M'; goto conv4; case UINT32_C(0x200F): c1 = 'R'; c2 = 'T'; c3 = 'L'; c4 = 'M'; goto conv4; case UINT32_C(0x202A): c1 = 'L'; c2 = 'T'; c3 = 'R'; c4 = 'E'; goto conv4; case UINT32_C(0x202B): c1 = 'R'; c2 = 'T'; c3 = 'L'; c4 = 'E'; goto conv4; case UINT32_C(0x202C): c1 = 'P'; c2 = 'D'; c3 = 'F'; goto conv3; case UINT32_C(0x202D): c1 = 'L'; c2 = 'T'; c3 = 'R'; c4 = 'O'; goto conv4; case UINT32_C(0x202E): c1 = 'R'; c2 = 'T'; c3 = 'L'; c4 = 'O'; goto conv4; case UINT32_C(0x2060): c1 = 'W'; c2 = 'J'; goto conv2; case UINT32_C(0x2066): c1 = 'L'; c2 = 'T'; c3 = 'R'; c4 = 'I'; goto conv4; case UINT32_C(0x2067): c1 = 'R'; c2 = 'T'; c3 = 'L'; c4 = 'I'; goto conv4; case UINT32_C(0x2068): c1 = 'F'; c2 = 'S'; c3 = 'I'; goto conv3; case UINT32_C(0x2069): c1 = 'P'; c2 = 'D'; c3 = 'I'; goto conv3; case UINT32_C(0x206A): c1 = 'I'; c2 = 'S'; c3 = 'S'; goto conv3; case UINT32_C(0x206B): c1 = 'A'; c2 = 'S'; c3 = 'S'; goto conv3; case UINT32_C(0x206C): c1 = 'I'; c2 = 'A'; c3 = 'F'; c4 = 'S'; goto conv4; case UINT32_C(0x206D): c1 = 'A'; c2 = 'A'; c3 = 'F'; c4 = 'S'; goto conv4; case UINT32_C(0x206E): c1 = 'N'; c2 = 'A'; c3 = 'D'; c4 = 'S'; goto conv4; case UINT32_C(0x206F): c1 = 'N'; c2 = 'O'; c3 = 'D'; c4 = 'S'; goto conv4; case UINT32_C(0xFFF9): c1 = 'I'; c2 = 'A'; c3 = 'A'; goto conv3; case UINT32_C(0xFFFA): c1 = 'I'; c2 = 'A'; c3 = 'S'; goto conv3; case UINT32_C(0xFFFB): c1 = 'I'; c2 = 'A'; c3 = 'T'; goto conv3; case UINT32_C(0x1BCA0): c1 = 'S'; c2 = 'F'; c3 = 'L'; c4 = 'O'; goto conv4; case UINT32_C(0x1BCA1): c1 = 'S'; c2 = 'F'; c3 = 'C'; c4 = 'O'; goto conv4; case UINT32_C(0x1BCA2): c1 = 'S'; c2 = 'F'; c3 = 'D'; c4 = 'S'; goto conv4; case UINT32_C(0x1BCA3): c1 = 'S'; c2 = 'F'; c3 = 'U'; c4 = 'S'; goto conv4; case UINT32_C(0xE0001): c1 = 'L'; c2 = 'T'; c3 = 'A'; c4 = 'G'; goto conv4; case UINT32_C(0xE007F): c1 = 'C'; c2 = 'T'; c3 = 'A'; c4 = 'G'; goto conv4; /* control characters (whitespace) */ /* case UINT32_C(0x20): c1 = 'S'; c2 = 'P'; goto conv2; */ case UINT32_C(0x00A0): c1 = 'N'; c2 = 'B'; c3 = 'S'; c4 = 'P'; goto conv4; case UINT32_C(0x2000): c1 = 'N'; c2 = 'Q'; goto conv2; case UINT32_C(0x2001): c1 = 'M'; c2 = 'Q'; goto conv2; case UINT32_C(0x2002): c1 = 'N'; c2 = 'S'; c3 = 'P'; goto conv3; case UINT32_C(0x2003): c1 = 'M'; c2 = 'S'; c3 = 'P'; goto conv3; case UINT32_C(0x2004): c1 = '3'; c2 = 'M'; c3 = 'S'; c4 = 'P'; goto conv4; case UINT32_C(0x2005): c1 = '4'; c2 = 'M'; c3 = 'S'; c4 = 'P'; goto conv4; case UINT32_C(0x2006): c1 = '6'; c2 = 'M'; c3 = 'S'; c4 = 'P'; goto conv4; case UINT32_C(0x2007): c1 = 'F'; c2 = 'S'; c3 = 'P'; goto conv3; case UINT32_C(0x2008): c1 = 'P'; c2 = 'S'; c3 = 'P'; goto conv3; case UINT32_C(0x2009): c1 = 'T'; c2 = 'S'; c3 = 'P'; goto conv3; case UINT32_C(0x200A): c1 = 'H'; c2 = 'S'; c3 = 'P'; goto conv3; case UINT32_C(0x2028): c1 = 'L'; c2 = 'S'; goto conv2; case UINT32_C(0x2029): c1 = 'P'; c2 = 'S'; goto conv2; case UINT32_C(0x202F): c1 = 'N'; c2 = 'N'; c3 = 'B'; c4 = 'S'; c5 = 'P'; goto conv5; case UINT32_C(0x205F): c1 = 'M'; c2 = 'M'; c3 = 'S'; c4 = 'P'; goto conv4; /* control characters (conditional characters) */ case UINT32_C(0x00AD): c1 = 'S'; c2 = 'H'; c3 = 'Y'; goto conv3; /* invisible */ case UINT32_C(0x2061): c = (uint_least32_t)'('; goto conv; case UINT32_C(0x2062): c = (uint_least32_t)'*'; goto conv; case UINT32_C(0x2063): c = (uint_least32_t)'|'; goto conv; case UINT32_C(0x2064): c = (uint_least32_t)'+'; goto conv; /* enclosed (positive) */ case UINT32_C(0x24EA): c1 = '('; c2 = '0'; c3 = ')'; goto conv3; case UINT32_C(0x2473): c1 = '('; c2 = '2'; c3 = '0'; c4 = ')'; goto conv4; case UINT32_C(0x1F1A5): c1 = '['; c2 = 'd'; c3 = ']'; goto conv3; case UINT32_C(0x24FE): c1 = '('; c2 = '('; c3 = '1'; c4 = '0'; c5 = ')'; c6 = ')'; goto conv6; case UINT32_C(0x2789): c1 = '('; c2 = '1'; c3 = '0'; c4 = ')'; goto conv4; case UINT32_C(0x1F10B): c1 = '('; c2 = '0'; c3 = ')'; goto conv3; /* enclosed (negative) */ case UINT32_C(0x24FF): c1 = '('; c2 = '0'; c3 = ')'; goto conv3; case UINT32_C(0x277F): c1 = '('; c2 = '1'; c3 = '0'; c4 = ')'; goto conv4; case UINT32_C(0x24F4): c1 = '('; c2 = '2'; c3 = '0'; c4 = ')'; goto conv4; case UINT32_C(0x2793): c1 = '('; c2 = '1'; c3 = '0'; c4 = ')'; goto conv4; case UINT32_C(0x1F10C): c1 = '('; c2 = '0'; c3 = ')'; goto conv3; /* metrical */ case UINT32_C(0x23D1): c1 = '1'; goto conv1; /* dentistry */ case UINT32_C(0x23C0): c1 = 'O'; goto conv1; case UINT32_C(0x23C3): c1 = 'A'; goto conv1; case UINT32_C(0x23C6): c1 = '~'; goto conv1; case UINT32_C(0x23BF): c1 = 'l'; goto conv1; case UINT32_C(0x23CC): c1 = 'j'; goto conv1; case UINT32_C(0x23CA): c1 = 't'; goto conv1; case UINT32_C(0x23BE): c1 = 'L'; goto conv1; case UINT32_C(0x23CB): c1 = 'J'; goto conv1; case UINT32_C(0x23C9): c1 = 'T'; goto conv1; case UINT32_C(0x23C1): c1 = '-'; c2 = 'O'; goto conv2; case UINT32_C(0x23C4): c1 = '-'; c2 = 'A'; goto conv2; case UINT32_C(0x23C7): c1 = '-'; c2 = '~'; goto conv2; case UINT32_C(0x23C2): c1 = '_'; c2 = 'O'; goto conv2; case UINT32_C(0x23C5): c1 = '_'; c2 = 'A'; goto conv2; case UINT32_C(0x23C8): c1 = '_'; c2 = '~'; goto conv2; default: no_match: *n += clen; s = &s[clen]; break; } } } no_conv: return LIBCHARCONV_NO_CONVERT; conv1: c = (uint_least32_t)c1; conv: if (*n) goto no_conv; *n += clen; if (*ncp) *cp = c; *ncp = 1u; return ret; conv2: if (*n) goto no_conv; *n += clen; conv2_prechecked: if (*ncp >= 1u) cp[0] = (uint_least32_t)c1; if (*ncp >= 2u) cp[1] = (uint_least32_t)c2; *ncp = 2u; return ret; conv3: if (*n) goto no_conv; *n += clen; conv3_prechecked: if (*ncp >= 1u) cp[0] = (uint_least32_t)c1; if (*ncp >= 2u) cp[1] = (uint_least32_t)c2; if (*ncp >= 3u) cp[2] = (uint_least32_t)c3; *ncp = 3u; return ret; conv4: if (*n) goto no_conv; *n += clen; if (*ncp >= 1u) cp[0] = (uint_least32_t)c1; if (*ncp >= 2u) cp[1] = (uint_least32_t)c2; if (*ncp >= 3u) cp[2] = (uint_least32_t)c3; if (*ncp >= 4u) cp[3] = (uint_least32_t)c4; *ncp = 4u; return ret; conv5: if (*n) goto no_conv; *n += clen; if (*ncp >= 1u) cp[0] = (uint_least32_t)c1; if (*ncp >= 2u) cp[1] = (uint_least32_t)c2; if (*ncp >= 3u) cp[2] = (uint_least32_t)c3; if (*ncp >= 4u) cp[3] = (uint_least32_t)c4; if (*ncp >= 5u) cp[4] = (uint_least32_t)c5; *ncp = 5u; return ret; conv6: if (*n) goto no_conv; *n += clen; if (*ncp >= 1u) cp[0] = (uint_least32_t)c1; if (*ncp >= 2u) cp[1] = (uint_least32_t)c2; if (*ncp >= 3u) cp[2] = (uint_least32_t)c3; if (*ncp >= 4u) cp[3] = (uint_least32_t)c4; if (*ncp >= 5u) cp[4] = (uint_least32_t)c5; if (*ncp >= 6u) cp[5] = (uint_least32_t)c6; *ncp = 6u; return ret; conv_str: if (*n) goto no_conv; *n += clen; i = 0u; for (; cs[i]; i++) if (*ncp > i) cp[i] = (uint_least32_t)cs[i]; *ncp = i; return ret; }