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
UTF8 decoding differs from Node #133
Comments
@dcousens is your document's character encoding set to utf-8?
|
@jessetane nailed it. How do we help make that obvious... can we perhaps inform users if doesn't exist? |
Interesting idea, something like |
When the effect is so subtle, I think such an error/warning would be greatly appreciated by most users. |
For what it's worth it looks like Firefox actually already does warn if your document's encoding is unspecified. |
Wow, I had no idea that the html document encoding could affect javascript strings! I guess that's just because I always use a utf8 document encoding. |
Sent a PR to resolve this issue: #134 |
Just to be precise about why this happened: the browser can only guess what encoding a source file is in unless you specify it via meta tag or http header. Of course everyone stores text files as utf-8 these days, but for backward compatibility the browser probably assumed iso-8859-1 and so OP just experienced this mismatch. |
@jessetane Thanks for the explanation. Lmk if you you think the wording could be improved in the PR. |
Closing, see PR for explanation. |
Code
Results
node v6.5.0
Chromium 53.0.2785.101
The text was updated successfully, but these errors were encountered: