summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
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)