summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Signes <rjbs@cpan.org>2012-02-28 11:54:24 -0500
committerRicardo Signes <rjbs@cpan.org>2012-02-28 11:54:24 -0500
commita1cf6078e8d77c83deb77e33919056fa0b2890f3 (patch)
tree40527c0b6a9a69f3ab8f30954f09b9f65c2bd555
parent5ef3c22d461004ed95fd0cee11e2926f8b87bc7c (diff)
downloadperl-smoke-me/utf8-dg.tar.gz
changes to UTF8_IS_DOWNGRADEABLE_STARTsmoke-me/utf8-dg
-rw-r--r--utf8.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/utf8.h b/utf8.h
index e558bb68d5..3c3b107010 100644
--- a/utf8.h
+++ b/utf8.h
@@ -144,7 +144,8 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
#define UTF8_IS_START(c) (((U8)c) >= 0xc0)
#define UTF8_IS_CONTINUATION(c) (((U8)c) >= 0x80 && (((U8)c) <= 0xbf))
#define UTF8_IS_CONTINUED(c) (((U8)c) & 0x80)
-#define UTF8_IS_DOWNGRADEABLE_START(c) (((U8)c & 0xfc) == 0xc0)
+#define UTF8_IS_DOWNGRADEABLE_START(c) (((U8)c) >= 0xc2 && (((U8)c) <= 0xc3))
+
#define UTF_START_MARK(len) (((len) > 7) ? 0xFF : (0xFE << (7-(len))))
#define UTF_START_MASK(len) (((len) >= 7) ? 0x00 : (0x1F >> ((len)-2)))