From 8bca6b4ec8a1d6147c0d877c9cf5d8441505aa20 Mon Sep 17 00:00:00 2001 From: Borewit Date: Fri, 17 Sep 2021 11:17:47 +0200 Subject: [PATCH] Support XML encoding with UTF-8 including BOM field (#491) --- core.js | 7 +++++++ fixture/fixture-utf8-bom.xml | 4 ++++ test.js | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 fixture/fixture-utf8-bom.xml diff --git a/core.js b/core.js index d3d6ab53..407b0e8d 100644 --- a/core.js +++ b/core.js @@ -1066,6 +1066,13 @@ async function _fromTokenizer(tokenizer) { }; } + if (check([0xEF, 0xBB, 0xBF]) && checkString(' + + UTF-8 with BOM + diff --git a/test.js b/test.js index b27bddd3..610a6f24 100644 --- a/test.js +++ b/test.js @@ -206,6 +206,10 @@ const names = { webm: [ 'fixture-null', // EBML DocType with trailing null character ], + xml: [ + 'fixture', + 'fixture-utf8-bom', // UTF-8 with BOM + ], }; // Define an entry here only if the file type has potential