我正在尝试连接Android应用中的服务器。只是服务器上的简单帖子,但我想用例如抛光类型,当我将字符集从UTF-8更改为iso8859-2时,它没有帮助。有什么想法吗?
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httppostreq = new HttpPost("http://simpleserver");
StringEntity se = new StringEntity(jsonMessage.toString());
se.setContentType("application/json;charset=ISO8859-2");
se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json;charset=ISO8859-2"));
httppostreq.setEntity(se);
HttpResponse httpresponse = httpclient.execute(httppostreq);