summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/chars.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/libguile/chars.h b/libguile/chars.h
index 85b16739a..69ef8d005 100644
--- a/libguile/chars.h
+++ b/libguile/chars.h
@@ -48,9 +48,13 @@ typedef scm_t_int32 scm_t_wchar;
: SCM_MAKE_ITAG8 ((scm_t_bits) (x), scm_tc8_char))
#define SCM_CODEPOINT_MAX (0x10ffff)
+#define SCM_CODEPOINT_SURROGATE_START (0xd800)
+#define SCM_CODEPOINT_SURROGATE_END (0xdfff)
#define SCM_IS_UNICODE_CHAR(c) \
- ((scm_t_wchar) (c) <= 0xd7ff \
- || ((scm_t_wchar) (c) >= 0xe000 && (scm_t_wchar) (c) <= SCM_CODEPOINT_MAX))
+ (((scm_t_wchar) (c) >= 0 \
+ && (scm_t_wchar) (c) < SCM_CODEPOINT_SURROGATE_START) \
+ || ((scm_t_wchar) (c) > SCM_CODEPOINT_SURROGATE_END \
+ && (scm_t_wchar) (c) <= SCM_CODEPOINT_MAX))