Android平台用okhttp的get请求抓取网页全文,然后中文乱码,如何破?页面编码 gb2312
认证0级讲师
You can use jsoup to capture the page. As for the garbled code conversion encoding format, is it useless?
OkHttp post request encoding problem solution methodIn the callback method onResponse method byte[] b = response.body().bytes(); //Get the bytes of dataString info = new String(b, "GB2312"); //Then convert it to gb2312
This is also okhttp crawling data and grabbing garbled characters You can take a lookhttp://www.qianlipp.com/124.html
You can use jsoup to capture the page. As for the garbled code conversion encoding format, is it useless?
OkHttp post request encoding problem solution method
In the callback method onResponse method
byte[] b = response.body().bytes(); //Get the bytes of data
String info = new String(b, "GB2312"); //Then convert it to gb2312
This is also okhttp crawling data and grabbing garbled characters
You can take a look
http://www.qianlipp.com/124.html