diff options
Diffstat (limited to 'libcharconv_latin.c')
| -rw-r--r-- | libcharconv_latin.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c index 047dee5..2668ab1 100644 --- a/libcharconv_latin.c +++ b/libcharconv_latin.c @@ -460,6 +460,19 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz })[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 { use_switch: switch (c) { @@ -655,6 +668,12 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz /* 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; |
