aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_latin.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libcharconv_latin.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c
index c52044c..ee975e1 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;
+ uint_least32_t c, cp1, cp2;
char c1, c2, c3, c4, c5, c6;
size_t i, clen;
unsigned num;
@@ -626,6 +626,10 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
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): c1 = '!'; c2 = '?'; goto conv2;
+ case UINT32_C(0x2E18): cp1 = UINT32_C(0xBF); cp2 = UINT32_C(0xA1); goto conv2cp;
+
default:
no_match:
*n += clen;
@@ -648,6 +652,17 @@ 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;