-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
iso8859-1 vs windows-1252 #25851
Comments
From a glance of the test I couldn't see how the encoding differences would come into play if the test itself was decoded properly. Was the test file stored in Windows-1252? And then got interpreted as utf8 by the CJS loader? |
The test loads the euro sign as utf8 and converts to latin1. With iso8859-1 it doesn't encode so it gets replaced by "?". |
Is this affected by |
Also #13722. |
I can check again, but iirc full icu doesn't fix this issue. If it did, the full icu build would fail the above mentioned test. |
Same actually also applies to "ascii". According to WHATWG it is to be interpreted as Windows-1252 as well. |
@srl295 as our ICU expert. |
We have a dedicated WHATWG text encoder/decoder |
Chromium's ICU considers "latin1" and "ascii" to mean Windows-1252, which is consistent with [WHATWG spec](https://encoding.spec.whatwg.org/#names-and-labels). If linked against Chromium's ICU, Node.js therefore fails `test/parallel/test-icu-transcode`. PR-URL: #25866 Refs: #25851 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Test fix landed. |
Chromium's ICU considers "latin1" and "ascii" to mean Windows-1252, which is consistent with [WHATWG spec](https://encoding.spec.whatwg.org/#names-and-labels). If linked against Chromium's ICU, Node.js therefore fails `test/parallel/test-icu-transcode`. PR-URL: #25866 Refs: #25851 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
sorry to miss this, but the fix looks good. |
This is somewhat related to #13722, but not quite.
Wikipedia contains the gist:
Chromium's ICU interprets "iso8859-1" to mean Windows-1252. Node.js does not. The WHATWG spec suggests Chromium's behavior to be correct.
The consequence of all of this is that when I build Node.js with Chromium's ICU,
test/parallel/test-icu-transcode.js
fails due to the character "€", which Windows-1252 includes, but ISO-8859-1 does not.I propose:
The text was updated successfully, but these errors were encountered: