Skip to content

Commit 29e2aa6

Browse files
Test UTF-32LE before UTF-16LE since UTF-16LE BOM is a prefix of UTF-32LE BOM.
1 parent e0cb9da commit 29e2aa6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

PC/launcher.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,12 @@ typedef struct {
965965
*/
966966
static BOM BOMs[] = {
967967
{ 3, { 0xEF, 0xBB, 0xBF }, CP_UTF8 }, /* UTF-8 - keep first */
968-
{ 2, { 0xFF, 0xFE }, CP_UTF16LE }, /* UTF-16LE */
969-
{ 2, { 0xFE, 0xFF }, CP_UTF16BE }, /* UTF-16BE */
968+
/* Test UTF-32LE before UTF-16LE since UTF-16LE BOM is a prefix
969+
* of UTF-32LE BOM. */
970970
{ 4, { 0xFF, 0xFE, 0x00, 0x00 }, CP_UTF32LE }, /* UTF-32LE */
971971
{ 4, { 0x00, 0x00, 0xFE, 0xFF }, CP_UTF32BE }, /* UTF-32BE */
972+
{ 2, { 0xFF, 0xFE }, CP_UTF16LE }, /* UTF-16LE */
973+
{ 2, { 0xFE, 0xFF }, CP_UTF16BE }, /* UTF-16BE */
972974
{ 0 } /* sentinel */
973975
};
974976

0 commit comments

Comments
 (0)