Skip to content
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

Sample files are loaded as Latin-1, breaking non-ASCII characters #3121

Open
mernen opened this issue Jan 16, 2025 · 0 comments
Open

Sample files are loaded as Latin-1, breaking non-ASCII characters #3121

mernen opened this issue Jan 16, 2025 · 0 comments

Comments

@mernen
Copy link

mernen commented Jan 16, 2025

What happened?

DartPad uses Latin-1 when parsing samples from the Flutter repository, even though they are UTF-8. This is likely because the server returns a content-type: application/vnd.dart header with no charset, and DartPad uses package:http, which defaults to Latin-1:

https://github.com/dart-lang/http/blob/7f50fc5b3d74a3031833226d93301b41593e2e61/pkgs/http/lib/src/response.dart#L20-L28

Steps to reproduce problem

  1. Visit the following Flutter sample: https://dartpad.dev/?sample_id=rendering.BoxParentData.1&channel=stable&run=true
  2. Check the third headline in the source code or running example, which should read "Bugs with greater impact on developers are more valuable (maximize ΔH)"
  3. Notice it ends with "(maximize �H)" instead

Additional info

Here's a direct link to the line in the sample code that exposes the issue:

https://github.com/flutter/flutter/blob/5517cc9b3b3bcf12431b47f495e342a30b738835/examples/api/lib/rendering/box/parent_data.0.dart#L49C15-L49C85

Browser

Browser: tested on Chrome and Safari for macOS

Version: Chrome 131.0.6778.265, Safari 18.2

Are you using any extensions/plugins that affect website behavior
(particularly those that affect iframes, such as ad blockers)? No

Are there any warnings or errors in your browser's JavaScript console?
If so, paste them below:

All logs appear to be typical for DartPad and unrelated to this issue

Machine

Operating system: macOS

Version: 14.7.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant