RESOLVED DUPLICATE of bug 216108 169858
Encoding: TextDecoder does not strip BOM
https://bugs.webkit.org/show_bug.cgi?id=169858
Summary Encoding: TextDecoder does not strip BOM
Attachments
Alexey Proskuryakov
Comment 1 2017-03-19 13:45:16 PDT
This seems like it may be performance sensitive. What's the rationale?
Anne van Kesteren
Comment 2 2017-03-20 00:58:09 PDT
This has been the behavior since the API was introduced. We did introduce a flag ignoreBOM that makes it not stripped. There's many UTF-8 entry points in the platform that strip a leading BOM, so offering that functionality seems very reasonable and since you know about whether or not it needs to happen when TextDecoder is constructed, it should not necessarily be performance-sensitive I think, but you might want to branch during decode for convenience, which shouldn't be too costly.
Alex Christensen
Comment 3 2020-09-02 20:06:55 PDT
*** This bug has been marked as a duplicate of bug 216108 ***
Note You need to log in before you can comment on or make changes to this bug.