Answers
采取Document document = Jsoup.parse(new URL(url).openStream(), "UTF-8", url);的方式获取,不要先获取网页html的文本,采用Jsoup.parse(html)的方式(即使在读html时设置了UTF-8,sb.append(new String(buf, 0, len, "UTF-8")); 这样也无效的)
Jsoup 采集回来的信息出现乱码
注:设置为UTF-8不是GBK
MI‘饭’
answered 10 years, 3 months ago