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

Need to override application/json default content decoder to UTF-8 #494

Closed
domesticmouse opened this issue Nov 7, 2020 · 3 comments
Closed
Labels
type-enhancement A request for a change that isn't a bug

Comments

@domesticmouse
Copy link
Member

domesticmouse commented Nov 7, 2020

I have a sample app that makes http get requests to Unsplash's API. The results are in the form of application/json, encoded in UTF-8. Unfortunately, the content-type on the return is application/json, not application/json; charset=utf-8.

See flutter/samples#586 for details.

Ask: allow overriding the default content type charset to UTF-8. Or, ignore the standard and make UTF-8 the default as it's what most people expect, and I suspect what web browsers do by default.

@DeD1rk
Copy link

DeD1rk commented Jul 13, 2021

See the discussion in #175. Indeed I believe http should change to strictly use UTF-8 for json by default.

@natebosch natebosch added the type-enhancement A request for a change that isn't a bug label Jul 15, 2021
@natebosch
Copy link
Member

I do think we should consider this.

In the mean time, the expected pattern is jsonDecode(utf8.decode(response.bodyBytes)), not jsonDecode(response.body).

@natebosch
Copy link
Member

Closing in favor of #175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants