WebView 乱码解决

webview.loadData("<html>乱码解</html>", "text/html", "utf-8");//-- 乱码
webview.loadDataWithBaseURL(null,"<html>乱码解决</html>", "text/html", "utf-8", null); //--ok


代码如下:
String URL = "file:///android_asset/test.html"
webview.loadUrl(url); 

若显示为乱码,则可尝试在test.html文件head标签中添加代码:
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    
                             

你可能感兴趣的:(webView)