]> granicus.if.org Git - php/commitdiff
Combine MBFL_ENCTYPE_MWC2{BE,LE} constants
authorAlex Dowad <alexinbeijing@gmail.com>
Tue, 13 Oct 2020 05:58:53 +0000 (07:58 +0200)
committerAlex Dowad <alexinbeijing@gmail.com>
Wed, 25 Nov 2020 17:52:19 +0000 (19:52 +0200)
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?)

ext/mbstring/libmbfl/filters/mbfilter_utf16.c
ext/mbstring/libmbfl/mbfl/mbfl_consts.h

index 10063883f2e617734aed713e4e286697a0e7bc7d..c2c30973db4691d83ee478610ba29f5cda3f8187 100644 (file)
@@ -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
 };
index 25d2ea0235595fb916cd4bb504cfda02b6d2945f..137cd0fcb8993c9402f16defbcb841933a88de81 100644 (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