Charset与服务器通信

时间:2015-09-03 05:54:51

标签: android

我正在尝试连接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);

0 个答案:

没有答案