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

Comments

Projects
None yet
4 participants
@ibc

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

This comment has been minimized.

Show comment
Hide comment
@ncr

ncr Nov 6, 2010

Just got bitten by this.

ncr commented Nov 6, 2010

Just got bitten by this.

@rubiii

This comment has been minimized.

Show comment
Hide comment
@rubiii

rubiii Nov 30, 2010

same here.

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