读取url内容后,有乱码 如何解决
URL url = new URL(link);
InputStream inputStream;
try {
inputStream = url.openStream();
} catch (Exception e) {
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
"192.168.0.2", 81));
URLConnection conn = url.openConnection(proxy);
conn.connect();
inputStream = conn.getInputStream();
}
BufferedReader dis = new BufferedReader(new InputStreamReader(
inputStream, "UTF-8"));
String line;
StringBuffer xmlBuffer = new StringBuffer();
while ((line = dis.readLine()) != null) {
xmlBuffer.append(line);
}
读取link得内容后,有乱码 如何解决。。?
------解决方案--------------------