Bug 169858 - Encoding: TextDecoder does not strip BOM
Summary: Encoding: TextDecoder does not strip BOM
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-19 06:19 PDT by Anne van Kesteren
Modified: 2017-03-20 00:58 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Alexey Proskuryakov 2017-03-19 13:45:16 PDT
This seems like it may be performance sensitive. What's the rationale?
Comment 2 Anne van Kesteren 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.