Android平台用okhttp的get请求抓取网页全文,然后中文乱码,如何破?
页面编码 gb2312
天蓬老师2017-04-17 15:38:19
You can use jsoup to capture the page. As for the garbled code conversion encoding format, is it useless?
天蓬老师2017-04-17 15:38:19
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
巴扎黑2017-04-17 15:38:19
This is also okhttp crawling data and grabbing garbled characters
You can take a look
http://www.qianlipp.com/124.html