当前位置: 代码迷 >> Web前端 >> WebView里展示中文乱码
  详细解决方案

WebView里展示中文乱码

热度:350   发布时间:2012-06-26 10:04:13.0
WebView里显示中文乱码

?? WebView里显示加载一段带中文的HTML时,使用webview.loadData(str,"text/html","utf-8");出现乱码,后面的编码也试过gbk或gb2312 ,或加上设置webview.getsettings().setdefaultEncode("utf-8")都没有效果.

?? 采用loadDataWithBaseURL(null,data, "text/html", "utf-8",null);就能显示中文了。

?? 原因待查