summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utf8.h1
-rw-r--r--utfebcdic.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
index bf8251a7ce..30537a88db 100644
--- a/utf8.h
+++ b/utf8.h
@@ -170,6 +170,7 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
/* Masking with 0xfe allows low bit to be 0 or 1; thus this matches 0xc[23] */
#define UTF8_IS_DOWNGRADEABLE_START(c) (((U8)c & 0xfe) == 0xc2)
+#define UTF8_IS_ABOVE_LATIN1(c) ((U8)(c) >= 0xc4)
#define UTF_START_MARK(len) (((len) > 7) ? 0xFF : (0xFE << (7-(len))))
diff --git a/utfebcdic.h b/utfebcdic.h
index 3eba83da99..16621036e7 100644
--- a/utfebcdic.h
+++ b/utfebcdic.h
@@ -570,6 +570,7 @@ END_EXTERN_C
#define UTF8_IS_CONTINUATION(c) ((NATIVE_TO_UTF(c) & 0xE0) == 0xA0)
#define UTF8_IS_CONTINUED(c) (NATIVE_TO_UTF(c) >= 0xA0)
#define UTF8_IS_DOWNGRADEABLE_START(c) (NATIVE_TO_UTF(c) >= 0xC5 && NATIVE_TO_UTF(c) <= 0xC7)
+#define UTF8_IS_ABOVE_LATIN1(c) (NATIVE_TO_I8(c) >= 0xC8)
#define UTF_START_MARK(len) (((len) > 7) ? 0xFF : ((U8)(0xFE << (7-(len)))))
#define UTF_START_MASK(len) (((len) >= 6) ? 0x01 : (0x1F >> ((len)-2)))