-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode without BOM #85
Comments
The obvious solution here would be to add an "ignore BOM flag" to the algorithm, but since whatwg/html#1077 (comment) potentially requires revamping things anyway, perhaps both should be tackled at once, to minimize the number of changes. |
The present spec concepts, when generalized to apply to all encodings (currently some only apply to UTF-8) result is:
encoding_rs already supports these generalizations. The mapping onto these from the current spec concepts is documented. |
So the problem is that https://url.spec.whatwg.org/#urlencoded-parsing is only for servers. Browsers only ever use it with UTF-8 (in Fetch and in the URL API). So I think the solution here is to not change Encoding, but rather change URL to only support UTF-8 and let servers modify the algorithm if they need more than UTF-8. |
For whatwg/url#84 I need a new specification hook of sorts. This is similar to what is already exposed through
TextDecoder
withignoreBOM
.(I should probably create some tests around this first though.)
The text was updated successfully, but these errors were encountered: