diff options
Diffstat (limited to '')
| -rw-r--r-- | libcharconv_latin.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c index 6baf82b..b1a2de2 100644 --- a/libcharconv_latin.c +++ b/libcharconv_latin.c @@ -18,7 +18,7 @@ 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, cp1, cp2; + uint_least32_t c; char c1, c2, c3, c4, c5, c6; size_t i, clen; unsigned num; @@ -627,8 +627,8 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz case UINT32_C(0x2152): c1 = '1'; c2 = '/'; c3 = '1'; c4 = '0'; goto conv4; /* overlaid */ - case UINT32_C(0x203D): c1 = '!'; c2 = '?'; goto conv2; - case UINT32_C(0x2E18): cp1 = UINT32_C(0xBF); cp2 = UINT32_C(0xA1); goto conv2cp; + case UINT32_C(0x203D): + case UINT32_C(0x2E18): c1 = '!'; c2 = '?'; goto conv2; /* joined */ case UINT32_C(0x2048): c1 = '?'; c2 = '!'; goto conv2; @@ -641,6 +641,13 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz 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; + default: no_match: *n += clen; @@ -663,17 +670,6 @@ conv: *ncp = 1u; return ret; -conv2cp: - if (*n) - goto no_conv; - *n += clen; - if (*ncp >= 1u) - cp[0] = cp1; - if (*ncp >= 2u) - cp[1] = cp2; - *ncp = 2u; - return ret; - conv2: if (*n) goto no_conv; |
