android webView.loadData亂碼解決
android webView.loadData 亂碼解決
webView.getSettings().setDefaultTextEncodingName("UTF -8");//設置默認為utf-8 webView.loadData(htmlData, "text/html", "UTF -8");//API提供的標準用法,無法解決亂碼問題 webView.loadData(htmlData, "text/html; charset=UTF-8", null);//這種寫法可以正確解碼
最後更新:2017-04-03 07:57:02