diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-08 03:19:03 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-08 03:19:03 +0000 |
commit | 8850bf83ea1d396a0a5bb6dd7e4d4b9556496409 (patch) | |
tree | 2669a238f1493c739d356da57cce74e4e88e3394 /utf8.h | |
parent | d414166bcc2e1302d8644cafbdb60c8b0cd1b419 (diff) | |
download | perl-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.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 : \ |