summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-08 03:19:03 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-08 03:19:03 +0000
commit8850bf83ea1d396a0a5bb6dd7e4d4b9556496409 (patch)
tree2669a238f1493c739d356da57cce74e4e88e3394 /utf8.h
parentd414166bcc2e1302d8644cafbdb60c8b0cd1b419 (diff)
downloadperl-8850bf83ea1d396a0a5bb6dd7e4d4b9556496409.tar.gz
Use the UTF8 macros a bit. They can't be used with abandon
everywhere because we do generate illegal UTF-8 in some situations. This is of course naughty. p4raw-id: //depot/perl@8033
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
index bafdc57f97..26ef7236ee 100644
--- a/utf8.h
+++ b/utf8.h
@@ -65,6 +65,11 @@ END_EXTERN_C
#define UTF8_IS_ASCII(c) ((c) < 0x80)
#define UTF8_IS_START(c) ((c) >= 0xc0 && ((c) <= 0xfd))
#define UTF8_IS_CONTINUATION(c) ((c) >= 0x80 && ((c) <= 0xbf))
+#define UTF8_IS_CONTINUED(c) ((c) & 0x80)
+
+#define UTF8_CONTINUATION_MASK 0x3f
+#define UTF8_ACCUMULATION_SHIFT 6
+#define UTF8_ACCUMULATE(old, new) ((old) << UTF8_ACCUMULATION_SHIFT | ((new) & UTF8_CONTINUATION_MASK))
#ifdef HAS_QUAD
#define UNISKIP(uv) ( (uv) < 0x80 ? 1 : \