appsup-dart / openid_client

Library for working with OpenID Connect and implementing clients.
BSD 3-Clause "New" or "Revised" License
90 stars 118 forks source link

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

Closed jlahd closed 1 year ago

jlahd commented 1 year ago

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 commented 1 year ago

Looks like a duplicate from: https://github.com/appsup-dart/openid_client/pull/79

jlahd commented 1 year ago

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