Json 乱码解决方法
Json 乱码乱码啊 乱码Java codeHttpClient client new DefaultHttpClient()HttpGet httpGet new Http
Json 乱码
乱码啊 乱码
Java codeHttpClient client = new DefaultHttpClient();HttpGet httpGet = new HttpGet(sUrl);HttpResponse response = client.execute(httpGet);String sJsonData = EntityUtils.toString(response.getEntity(), "UTF-8");
服务器发过来的是utf-8没错啊 怎么回事啊
[解决办法]方法1:
在右键点击项目 -> Properties -> Resource -> Text file encoding -> Other -> UTF-8
方法2、改为GBK看看
String sJsonData = EntityUtils.toString(response.getEntity(), "GBK");
[解决办法]这个要看服务器发过来的头是什么
是不是有GZIP之类的
[解决办法]还有一种可能,服务器将GBK一类的东西直接用UTF8发过来了
可以问下服务器发送端
自己这边可以试下UTF8接受,然后转码显示