IOUtils.readUTF8 and IOUtils.readJSON should strip the UTF-8 BOM if any
Categories
(Toolkit :: IOUtils and PathUtils, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: robwu, Assigned: beth)
References
Details
Attachments
(2 files)
Bug 1835790 is a regression caused by the replacement of OS.File.read
with IOUtils.readUTF8
. This regression happened because an external (JSON) file was read and failed to be parsed because there was an UTF-8 BOM in front of it.
IOUtils.readUTF8
and IOUtils.readJSON
should strip the UTF-8 BOM if any, possibly as an option if you want it to be used exclusively for externally-provided files. This stripping can be implemented at https://searchfox.org/mozilla-central/rev/27e4816536c891d85d63695025f2549fd7976392/dom/system/IOUtils.cpp#1285
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Reporter | ||
Comment 2•2 years ago
|
||
Now that IOUtils.readUTF8 automatically drops the BOM, the consumer in
NativeManifests.sys.mjs does not need to do that manually any more.
Depends on D180136
Comment 4•2 years ago
|
||
Backed out for causing mochitest failures on test_ioutils_read_write_utf8.html
Assignee | ||
Updated•2 years ago
|
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7c5101ddab4e
https://hg.mozilla.org/mozilla-central/rev/32aa10fc8f27
Description
•