summaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2015-02-12 00:11:31 +0000
committerHugo van der Sanden <hv@crypt.org>2015-02-12 12:30:01 +0000
commitd52b857690116b4b653e6dd1781067e8c72e6f62 (patch)
treefa3407e717f509b2d1d9e31a8f102a14d8d02c0b /utf8.h
parentf624cb736a20c433d4e81c202222fc4ff50afe4c (diff)
downloadperl-d52b857690116b4b653e6dd1781067e8c72e6f62.tar.gz
fix assertions for UTF8_TWO_BYTE_HI/LO
Replace the stricter MAX_PORTABLE_UTF8_TWO_BYTE check with a looser MAX_UTF8_TWO_BYTE check, else we can't correctly convert codepoints in the range 0x400-0x7ff from utf16 to utf8 on non-ebcdic platforms.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/utf8.h b/utf8.h
index aaf878cbff..8418055b96 100644
--- a/utf8.h
+++ b/utf8.h
@@ -393,15 +393,15 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
* code point whose UTF-8 is known to occupy 2 bytes; they are less efficient
* than the EIGHT_BIT versions on EBCDIC platforms. We use the logical '~'
* operator instead of "<=" to avoid getting compiler warnings.
- * MAX_PORTABLE_UTF8_TWO_BYTE should be exactly all one bits in the lower few
+ * MAX_UTF8_TWO_BYTE should be exactly all one bits in the lower few
* places, so the ~ works */
#define UTF8_TWO_BYTE_HI(c) \
(__ASSERT_((sizeof(c) == 1) \
- || !(((WIDEST_UTYPE)(c)) & ~MAX_PORTABLE_UTF8_TWO_BYTE)) \
+ || !(((WIDEST_UTYPE)(c)) & ~MAX_UTF8_TWO_BYTE)) \
((U8) __BASE_TWO_BYTE_HI(c, NATIVE_TO_UNI)))
#define UTF8_TWO_BYTE_LO(c) \
(__ASSERT_((sizeof(c) == 1) \
- || !(((WIDEST_UTYPE)(c)) & ~MAX_PORTABLE_UTF8_TWO_BYTE)) \
+ || !(((WIDEST_UTYPE)(c)) & ~MAX_UTF8_TWO_BYTE)) \
((U8) __BASE_TWO_BYTE_LO(c, NATIVE_TO_UNI)))
/* This is illegal in any well-formed UTF-8 in both EBCDIC and ASCII