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
HttpResponse.parseAsString() should respect charset Content-Type parameter #41
Comments
From yan...@google.com on October 28, 2011 09:46:45 Labels: -Milestone-Version1.6.0 Milestone-Version1.7.0 |
From rmis...@google.com on November 14, 2011 09:27:31 Looks like this was fixed by Yaniv in http://codereview.appspot.com/5320060/ . Status: Fixed |
From yan...@google.com on November 14, 2011 09:37:43 The fix I made was to assume the content type is UTF-8 which is usually the case. In theory the charset might not be UTF-8, so the ideal fix is to actually read the charset parameter. But let's punt the ideal fix until we hear actual user demand for this feature. Status: Accepted |
From esch...@gmail.com on February 14, 2012 13:51:33 Right, we need to have string in encoding specified by response's Content-Type header |
From yan...@google.com on May 21, 2012 12:52:31 Status: Started |
From yan...@google.com on May 21, 2012 12:58:20 |
From yan...@google.com on May 22, 2012 05:07:12 Status: Fixed |
Update version to 0.4.0-SNAPSHOT
From yan...@google.com on October 12, 2011 19:17:05
Version of google-http-java-client (e.g. 1.5.0-beta)? 1.5.0-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? All Describe the problem. HttpResponse.parseAsString() uses the platform's default charset when parsing the content, even if the Content-Type header looks like this:
Content-Type: application/json; charset=UTF-8
Reference: https://code.google.com/p/google-http-java-client/source/browse/google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java#420 How would you expect it to be fixed? I would expect parseAsString() to read the charset parameter from the Content-Type header to determine the character set to use to parse. Typically this will be UTF-8, which will typically be different from the platform's default encoding.
Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=41
The text was updated successfully, but these errors were encountered: