summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-09-08 23:24:34 +0200
committerMattias Andrée <maandree@kth.se>2021-09-08 23:24:39 +0200
commit84b8038689a1b289aeaf0efb2c0545dec79c1888 (patch)
treec81de8773a3b09e137b82ca1686dc23e31118fda /common.h
parentFix typo (diff)
downloadlibnumtext-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.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/common.h b/common.h
index 7fb6784..51e7689 100644
--- a/common.h
+++ b/common.h
@@ -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)