Skip to content

Decode JSON responses in UTF-8, not Latin-1#86

Closed
jlahd wants to merge 1 commit intoappsup-dart:masterfrom
jlahd:json-is-utf8
Closed

Decode JSON responses in UTF-8, not Latin-1#86
jlahd wants to merge 1 commit intoappsup-dart:masterfrom
jlahd:json-is-utf8

Conversation

@jlahd
Copy link

@jlahd jlahd commented Jun 9, 2023

As per RFC 4627, JSON is UTF-8 by default (with UTF-16 or UTF-32 as other two possible encodings). However, the http library uses Latin-1 decoding, unless there is an explicit character set definition in the response headers.
Most notably, this breaks Credential.getUserInfo() when the user's name has non-ASCII characters in it.

@zigapovhe
Copy link

Looks like a duplicate from: #79

@jlahd
Copy link
Author

jlahd commented Jun 27, 2023

True, it is. Sorry, missed the original PR and reinvented the wheel.

@jlahd jlahd closed this Jun 27, 2023
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

Successfully merging this pull request may close these issues.

2 participants