2
4

1 回答 1

4

The text encoding problem was happening because the call which is made to the GSA server using Apache HTTP Client was using a default content encoding character set of iso-8859-1 but the GSA server expected the HTTP Client request and response to be in UTF-8 encoding.

This problem got resolved after setting the encoding for HTTPClient -

HttpClient httpClient = new HttpClient();
httpClient.getParams().setContentCharset("UTF-8");

And the servlet response encoding to

response.setContentType("application/json;charset=UTF-8");

于 2013-04-15T06:07:20.280 回答