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 characters render differently in the browser than in the console #16800
Comments
I tried this in the console and the input string matches the round-trip string. (See sample code at the bottom.) This may have to do with how the browser handles special characters when test as text. I attached a screen shot of running the sample through an html page. I then copy-pasted the encoded output to the Javascript console. Some weird discrepancies. *** sample *** import 'dart:convert'; void main() { var encoded = JSON.encode(list); print(input == encoded); Attachment: Added Library-Html, Triaged labels. |
This comment was originally written by jcbr...@gmail.com No, the conversion in OSX Mavericks is render wrong charset. Look in code: Attachment: |
This comment was originally written by jcbr...@gmail.com May be this issue happens only in osx. I dont remember this in windows. |
I can't repro this on either OSX or Linux. This character is a fairly common one (\u00ED;LATIN SMALL LETTER I WITH ACUTE;Ll;0;L), font issue seems surprising, though console output is definitely not held to the same standard as page rendering. Can also test this via JS in the console: JSON.parse('[{"nome":"alícia"}]') or just this should repro: If it does not repro in JS then it's more of a Dart issue and should definitely be tracked down. |
This does not sound like a JSON decode problem. The input to JSON.decode is a Dart string, so it is always UTF-16, no matter what how the source code was encoded. Does the same problem happen if you write the value as a Dart literal: I see no problem when running this on Linux in the stand-alone Dart-VM, or through the Dart Editor. Could be OSX only - my command line shell is unicode aware, so it prints correctly. The picture shows that the Editor doesn't recognize the source code as UTF-8, but probably thinks it is ISO-Latin-1 or Windows-1252. Can you try opening the inspector in Dartium (this will break the debug connection to the editor, but that's fine for now), click on the "Network" tab, and then reload the page. Then check the "table.html" file's "headers" tab, under "Response headers", and see what the "Content-Type" entry says? (Tentatively setting to Area-Editor until we know more) Removed Library-Html label. |
This comment was originally written by jcbri...@gmail.com Content-Type:text/html |
I tried this on both Mac and Linux, and it appears to work as intended (Mac screenshots attached). Perhaps this is an issue related to the OS language setting? Attachments: |
Removed Area-Editor label. |
This comment was originally written by jsing...@gmail.com This might be related to bug 18150. No encoding seems to be set when the editor serves the file: HTTP/1.1 200 OK |
Set owner to @alan-knight. |
Closing this issue as duplicate of #18150. |
This issue was originally filed by jcbritob...@gmail.com
What steps will reproduce the problem?
What is the expected output? What do you see instead?
in console or html page the correct charset - alícia
What version of the product are you using? On what operating system?
Dart SDK 1.1.3 in MAC OSX Mavericks
Attachments:
table.html (484 Bytes)
table.dart (1.02 KB)
The text was updated successfully, but these errors were encountered: