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

FeatureRequest: Let `.content` use the charset specified by the server #5

smls opened this Issue Sep 30, 2017 · 1 comment


None yet
2 participants

smls commented Sep 30, 2017

Unless the user specifies something different, the .content method currently decodes the response content as utf-8.

But HTTP actually has a way for the server to tell us how the content should be interpreted:

Content-Type: text/html; charset=utf-8

It's cumbersome for users of the module to have to manually parse this after every request.

Any chance the module could do it automatically, and use that charset by default for decoding the content?
It could still fall back to utf-8 if no Content-Type header was received.


This comment has been minimized.

Show comment
Hide comment

CurtTilmes Oct 11, 2017


Added a patch for this with a basic parser for Content-Type/charset.


CurtTilmes commented Oct 11, 2017

Added a patch for this with a basic parser for Content-Type/charset.

@CurtTilmes CurtTilmes closed this Oct 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment