diff options
author | Karl Williamson <khw@cpan.org> | 2017-06-26 11:43:21 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-07-12 21:14:25 -0600 |
commit | d044b7a780a1f1916e96ed7d255bb0b7dad54713 (patch) | |
tree | a5546bb6e038dcc30b9c8d73cd8fa7b99a9d1e37 /utf8.h | |
parent | 9e35eec98dba17eb946a8462b68223b962fdcf46 (diff) | |
download | perl-d044b7a780a1f1916e96ed7d255bb0b7dad54713.tar.gz |
utf8.h: Add synonyms for flag names
The next commit will fix the detection of using Perl's extended UTF-8 to
be more accurate. The current name for various flags in the API is
somewhat misleading. What is really wanted to know is if extended UTF-8
was used, not the value of the resultant code point.
This commit basically does
s/ABOVE_31_BIT/PERL_EXTENDED/g
It also similarly changes the name of a hash key in APItest/t/utf8.t.
This intermediary step makes the next commit easier to read.
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 33 |
1 files changed, 19 insertions, 14 deletions
@@ -777,13 +777,16 @@ case any call to string overloading updates the internal UTF-8 encoding flag. * went up to 2 ** 31 - 1. Note that these all overflow a signed 32-bit word, * The first byte of these code points is FE or FF on ASCII platforms. If the * first byte is FF, it will overflow a 32-bit word. */ -#define UTF8_DISALLOW_ABOVE_31_BIT 0x4000 -#define UTF8_GOT_ABOVE_31_BIT UTF8_DISALLOW_ABOVE_31_BIT -#define UTF8_WARN_ABOVE_31_BIT 0x8000 +#define UTF8_DISALLOW_PERL_EXTENDED 0x4000 +#define UTF8_GOT_PERL_EXTENDED UTF8_DISALLOW_PERL_EXTENDED +#define UTF8_WARN_PERL_EXTENDED 0x8000 /* For back compat, these old names are misleading for UTF_EBCDIC */ -#define UTF8_DISALLOW_FE_FF UTF8_DISALLOW_ABOVE_31_BIT -#define UTF8_WARN_FE_FF UTF8_WARN_ABOVE_31_BIT +#define UTF8_DISALLOW_ABOVE_31_BIT UTF8_DISALLOW_PERL_EXTENDED +#define UTF8_GOT_ABOVE_31_BIT UTF8_GOT_PERL_EXTENDED +#define UTF8_WARN_ABOVE_31_BIT UTF8_WARN_PERL_EXTENDED +#define UTF8_DISALLOW_FE_FF UTF8_DISALLOW_PERL_EXTENDED +#define UTF8_WARN_FE_FF UTF8_WARN_PERL_EXTENDED #define UTF8_CHECK_ONLY 0x10000 #define _UTF8_NO_CONFIDENCE_IN_CURLEN 0x20000 /* Internal core use only */ @@ -907,14 +910,16 @@ point's representation. * let's be conservative and do as Unicode says. */ #define PERL_UNICODE_MAX 0x10FFFF -#define UNICODE_WARN_SURROGATE 0x0001 /* UTF-16 surrogates */ -#define UNICODE_WARN_NONCHAR 0x0002 /* Non-char code points */ -#define UNICODE_WARN_SUPER 0x0004 /* Above 0x10FFFF */ -#define UNICODE_WARN_ABOVE_31_BIT 0x0008 /* Above 0x7FFF_FFFF */ -#define UNICODE_DISALLOW_SURROGATE 0x0010 -#define UNICODE_DISALLOW_NONCHAR 0x0020 -#define UNICODE_DISALLOW_SUPER 0x0040 -#define UNICODE_DISALLOW_ABOVE_31_BIT 0x0080 +#define UNICODE_WARN_SURROGATE 0x0001 /* UTF-16 surrogates */ +#define UNICODE_WARN_NONCHAR 0x0002 /* Non-char code points */ +#define UNICODE_WARN_SUPER 0x0004 /* Above 0x10FFFF */ +#define UNICODE_WARN_PERL_EXTENDED 0x0008 /* Above 0x7FFF_FFFF */ +#define UNICODE_WARN_ABOVE_31_BIT UNICODE_WARN_PERL_EXTENDED +#define UNICODE_DISALLOW_SURROGATE 0x0010 +#define UNICODE_DISALLOW_NONCHAR 0x0020 +#define UNICODE_DISALLOW_SUPER 0x0040 +#define UNICODE_DISALLOW_PERL_EXTENDED 0x0080 +#define UNICODE_DISALLOW_ABOVE_31_BIT UNICODE_DISALLOW_PERL_EXTENDED #define UNICODE_WARN_ILLEGAL_C9_INTERCHANGE \ (UNICODE_WARN_SURROGATE|UNICODE_WARN_SUPER) #define UNICODE_WARN_ILLEGAL_INTERCHANGE \ @@ -953,7 +958,7 @@ point's representation. && UNICODE_IS_END_PLANE_NONCHAR_GIVEN_NOT_SUPER(uv))) #define UNICODE_IS_SUPER(uv) ((UV) (uv) > PERL_UNICODE_MAX) -#define UNICODE_IS_ABOVE_31_BIT(uv) ((UV) (uv) > 0x7FFFFFFF) +#define UNICODE_IS_PERL_EXTENDED(uv) ((UV) (uv) > 0x7FFFFFFF) #define LATIN_SMALL_LETTER_SHARP_S LATIN_SMALL_LETTER_SHARP_S_NATIVE #define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS \ |