Skip to content

#94 UTF-8 as default charset for response body decoding #95

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

Conversation

sanekyy
Copy link
Contributor

@sanekyy sanekyy commented May 27, 2020

No description provided.

///
/// Returns [fallback] if [charset] is null or if no [Encoding] was found that
/// corresponds to [charset].
Encoding encodingForCharset(String charset, [Encoding fallback = utf8]) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it have to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Fixed.

return HttpResponse(response.statusCode,
body: response.body, headers: response.headers);
final responseBody =
_encodingForHeaders(response.headers).decode(response.bodyBytes);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test for this change please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

sanekyy added 2 commits May 28, 2020 14:33
add opportunity to configure default encoding
@sanekyy sanekyy requested a review from f3ath May 28, 2020 11:35
@f3ath f3ath merged commit 3bf3bbd into f3ath:master May 28, 2020
@f3ath
Copy link
Owner

f3ath commented May 28, 2020

Thank you!

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