今天用WebView加载的时候出现了乱码,但是我确实是用额utf-8啊, 觉得奇怪,最后通过这个方法解决了问题,就是把:
webContext.loadData(content,"text/html","utf-8");
改为
webContext.loadData(content,"text/html;charset=UTF-8",null);
如果还是不行就改为:
webContext.loadDataWithBaseURL(null, content, "text/html", "UTF-8", null);
网友评论