I don't think there is a better answer using API HttpClient3.x.
The HTTP 1.1 specification clearly states that the client "must" respect the character set specified in the response header and use ISO-8859-1 if no character set is specified. The APIs are HttpClientdesigned so that the programmer wants to comply with the HTTP specifications. Obviously, you need to break the rules in the specification so that you can talk to an inappropriate server. Unable to withstand this, this is not the case when API designers clearly needed support.
If you used HttpClient4.x, you can write your own ResponseHandlerto convert the body to HttpEntity, ignoring the conditional character set of the response message.
source
share