diff options
author | Mattias Andrée <maandree@kth.se> | 2021-09-08 23:24:34 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-09-08 23:24:39 +0200 |
commit | 84b8038689a1b289aeaf0efb2c0545dec79c1888 (patch) | |
tree | c81de8773a3b09e137b82ca1686dc23e31118fda /common.h | |
parent | Fix typo (diff) | |
download | libnumtext-84b8038689a1b289aeaf0efb2c0545dec79c1888.tar.gz libnumtext-84b8038689a1b289aeaf0efb2c0545dec79c1888.tar.bz2 libnumtext-84b8038689a1b289aeaf0efb2c0545dec79c1888.tar.xz |
misc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -28,7 +28,13 @@ #endif -#define UNICODE_MINUS "−" +#define UNICODE_MINUS "−" /* \xe2\x88\x92 */ +#define UNICODE_NBSP " " /* \xc2\xa0 */ + +#define IS_CHAR__(S, LEN, C) ((LEN) >= sizeof(C) - 1 && !memcmp((S), (C), sizeof(C) - 1)) + +#define IS_UNICODE_MINUS(S, LEN) IS_CHAR__(S, LEN, UNICODE_MINUS) +#define IS_UNICODE_NBSP(S, LEN) IS_CHAR__(S, LEN, UNICODE_NBSP) #define IS_UTF8_CHAR_CONTINUATION(B) (((B) & 0xC0) == 0x80) |