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

Encoding of the response body and Ruby1.9 #26

Closed
ibc opened this issue Dec 2, 2009 · 2 comments
Closed

Encoding of the response body and Ruby1.9 #26

ibc opened this issue Dec 2, 2009 · 2 comments

Comments

@ibc
Copy link

ibc commented Dec 2, 2009

Hi, in Ruby1.9 when httpclient gets a response wth body, that body is encoded as US-ASCII even if the HTTP response contains:

Content-Type: lalala/lololo;charset=UTF-8

This forces me to convert the got body to UTF-8 by running:
body.force-encoding(:'UTF-8')

It would be great if httpclient would, by itself, encode the retrieved body in the appropiate endoding, which could be (ir orden or preference):

  1. The value of "charset" param ni Content-Type header.
  2. A default encoding set by the user when configuring the httpclient instance (or as a new parametner in 'request' method).
@ncr
Copy link

ncr commented Nov 6, 2010

Just got bitten by this.

@rubiii
Copy link

rubiii commented Nov 30, 2010

same here.

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

No branches or pull requests

4 participants