aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_latin.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-01-25 15:06:50 +0100
committerMattias Andrée <m@maandree.se>2026-01-25 15:06:50 +0100
commit53160a89e5d723fb8315ebb087426405973b01ad (patch)
tree7b7b6e695e686b2e6c659a57a32bc887d00badd9 /libcharconv_latin.c
parentUse a macro for all utils that do not take arguments (diff)
downloadcharconv-53160a89e5d723fb8315ebb087426405973b01ad.tar.gz
charconv-53160a89e5d723fb8315ebb087426405973b01ad.tar.bz2
charconv-53160a89e5d723fb8315ebb087426405973b01ad.tar.xz
Add vulgar fractions
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcharconv_latin.c')
-rw-r--r--libcharconv_latin.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libcharconv_latin.c b/libcharconv_latin.c
index 232eb5c..c52044c 100644
--- a/libcharconv_latin.c
+++ b/libcharconv_latin.c
@@ -603,6 +603,29 @@ libcharconv_latin(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
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;
+
default:
no_match:
*n += clen;