@@ -1128,15 +1128,15 @@ point's representation.
11281128/* Largest code point we accept from external sources */
11291129#define MAX_LEGAL_CP ((UV)IV_MAX)
11301130
1131- #define UTF8_ALLOW_EMPTY 0x0001 /* Allow a zero length string */
1131+ #define UTF8_ALLOW_EMPTY 0x0002 /* Allow a zero length string */
11321132#define UTF8_GOT_EMPTY UTF8_ALLOW_EMPTY
11331133
11341134/* Allow first byte to be a continuation byte */
1135- #define UTF8_ALLOW_CONTINUATION 0x0002
1135+ #define UTF8_ALLOW_CONTINUATION 0x0004
11361136#define UTF8_GOT_CONTINUATION UTF8_ALLOW_CONTINUATION
11371137
11381138/* Unexpected non-continuation byte */
1139- #define UTF8_ALLOW_NON_CONTINUATION 0x0004
1139+ #define UTF8_ALLOW_NON_CONTINUATION 0x0010
11401140#define UTF8_GOT_NON_CONTINUATION UTF8_ALLOW_NON_CONTINUATION
11411141
11421142/* expecting more bytes than were available in the string */
@@ -1146,26 +1146,26 @@ point's representation.
11461146/* Overlong sequence; i.e., the code point can be specified in fewer bytes.
11471147 * First one will convert the overlong to the REPLACEMENT CHARACTER; second
11481148 * will return what the overlong evaluates to */
1149- #define UTF8_ALLOW_LONG 0x0010
1150- #define UTF8_ALLOW_LONG_AND_ITS_VALUE (UTF8_ALLOW_LONG|0x0020 )
1149+ #define UTF8_ALLOW_LONG 0x2000
1150+ #define UTF8_ALLOW_LONG_AND_ITS_VALUE (UTF8_ALLOW_LONG|0x4000 )
11511151#define UTF8_GOT_LONG UTF8_ALLOW_LONG
11521152
1153- #define UTF8_ALLOW_OVERFLOW 0x0080
1153+ #define UTF8_ALLOW_OVERFLOW 0x0001
11541154#define UTF8_GOT_OVERFLOW UTF8_ALLOW_OVERFLOW
11551155
1156- #define UTF8_DISALLOW_SURROGATE 0x0100 /* Unicode surrogates */
1156+ #define UTF8_DISALLOW_SURROGATE 0x0020 /* Unicode surrogates */
11571157#define UTF8_GOT_SURROGATE UTF8_DISALLOW_SURROGATE
1158- #define UTF8_WARN_SURROGATE 0x0200
1158+ #define UTF8_WARN_SURROGATE 0x0040
11591159
11601160/* Unicode non-character code points */
1161- #define UTF8_DISALLOW_NONCHAR 0x0400
1161+ #define UTF8_DISALLOW_NONCHAR 0x0800
11621162#define UTF8_GOT_NONCHAR UTF8_DISALLOW_NONCHAR
1163- #define UTF8_WARN_NONCHAR 0x0800
1163+ #define UTF8_WARN_NONCHAR 0x1000
11641164
11651165/* Super-set of Unicode: code points above the legal max */
1166- #define UTF8_DISALLOW_SUPER 0x1000
1166+ #define UTF8_DISALLOW_SUPER 0x0200
11671167#define UTF8_GOT_SUPER UTF8_DISALLOW_SUPER
1168- #define UTF8_WARN_SUPER 0x2000
1168+ #define UTF8_WARN_SUPER 0x0400
11691169
11701170/* The original UTF-8 standard did not define UTF-8 with start bytes of 0xFE or
11711171 * 0xFF, though UTF-EBCDIC did. This allowed both versions to represent code
@@ -1176,9 +1176,9 @@ point's representation.
11761176 * extensions, and not likely to be interchangeable with other languages. Note
11771177 * that on ASCII platforms, FE overflows a signed 32-bit word, and FF an
11781178 * unsigned one. */
1179- #define UTF8_DISALLOW_PERL_EXTENDED 0x4000
1179+ #define UTF8_DISALLOW_PERL_EXTENDED 0x0080
11801180#define UTF8_GOT_PERL_EXTENDED UTF8_DISALLOW_PERL_EXTENDED
1181- #define UTF8_WARN_PERL_EXTENDED 0x8000
1181+ #define UTF8_WARN_PERL_EXTENDED 0x0100
11821182
11831183/* For back compat, these old names are misleading for overlongs and
11841184 * UTF_EBCDIC. */
@@ -1188,8 +1188,8 @@ point's representation.
11881188#define UTF8_DISALLOW_FE_FF UTF8_DISALLOW_PERL_EXTENDED
11891189#define UTF8_WARN_FE_FF UTF8_WARN_PERL_EXTENDED
11901190
1191- #define UTF8_CHECK_ONLY 0x10000
1192- #define _UTF8_NO_CONFIDENCE_IN_CURLEN 0x20000 /* Internal core use only */
1191+ #define UTF8_CHECK_ONLY 0x8000
1192+ #define _UTF8_NO_CONFIDENCE_IN_CURLEN 0x10000 /* Internal core use only */
11931193
11941194/* For backwards source compatibility. They do nothing, as the default now
11951195 * includes what they used to mean. The first one's meaning was to allow the
0 commit comments