1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

Combine MBFL_ENCTYPE_MWC2{BE,LE} constants

These constants indicate that a text encoding uses 2+ bytes for each character,
and is either big endian or little endian (respectively). But nothing in
mbstring cares about the difference between MBFL_ENCTYPE_MWC2BE and
MBFL_ENCTYPE_MWC2LE.

(Actually, nothing cares about whether these flags are set at all...
maybe we should just remove them?)
This commit is contained in:
Alex Dowad
2020-10-13 07:58:53 +02:00
parent 72660c416a
commit bbbadae0ae
2 changed files with 4 additions and 5 deletions
@@ -40,7 +40,7 @@ const mbfl_encoding mbfl_encoding_utf16 = {
"UTF-16",
mbfl_encoding_utf16_aliases,
NULL,
MBFL_ENCTYPE_MWC2BE,
MBFL_ENCTYPE_MWC2,
&vtbl_utf16_wchar,
&vtbl_wchar_utf16
};
@@ -51,7 +51,7 @@ const mbfl_encoding mbfl_encoding_utf16be = {
"UTF-16BE",
NULL,
NULL,
MBFL_ENCTYPE_MWC2BE,
MBFL_ENCTYPE_MWC2,
&vtbl_utf16be_wchar,
&vtbl_wchar_utf16be
};
@@ -62,7 +62,7 @@ const mbfl_encoding mbfl_encoding_utf16le = {
"UTF-16LE",
NULL,
NULL,
MBFL_ENCTYPE_MWC2LE,
MBFL_ENCTYPE_MWC2,
&vtbl_utf16le_wchar,
&vtbl_wchar_utf16le
};
+1 -2
View File
@@ -34,8 +34,7 @@
#define MBFL_ENCTYPE_SBCS 0x00000001 /* single-byte encoding */
#define MBFL_ENCTYPE_MBCS 0x00000002 /* multi-byte encoding */
#define MBFL_ENCTYPE_WCS2 0x00000010 /* 2 bytes/char */
#define MBFL_ENCTYPE_MWC2BE 0x00000040 /* 2+ bytes/char, big endian */
#define MBFL_ENCTYPE_MWC2LE 0x00000080 /* 2+ bytes/char, little endian */
#define MBFL_ENCTYPE_MWC2 0x00000040 /* 2+ bytes/char */
#define MBFL_ENCTYPE_WCS4 0x00000100 /* 4 bytes/char */
#define MBFL_ENCTYPE_GL_UNSAFE 0x00004000