机器人的WebView乱码UTF-8字符。乱码、机器人、字符、WebView

由网友(▲有没有猪妞噶小白菜)分享简介:我用我的Andr​​oid应用程序的一些webviews,但不能使他们在UTF-8编码显示。I'm using some webviews in my android app, but are unable to make them display in utf-8 encoding.如果用这个,我不会看到我的斯堪...

我用我的Andr​​oid应用程序的一些webviews,但不能使他们在UTF-8编码显示。

I'm using some webviews in my android app, but are unable to make them display in utf-8 encoding.

如果用这个,我不会看到我的斯堪的纳维亚charcters:

If use this one I won't see my scandinavian charcters:

mWebView.loadUrl("file:///android_asset/om.html")

如果试试这个,我不会得到任何东西显示在所有

And if try this one, I won't get anything displayed at all

mWebView.loadDataWithBaseURL("file:///android_asset/om.html", null, "text/html", "utf-8",null);

问候

推荐答案

您可以试试,然后再加载数据编辑您的WebView的设置:

You can try to edit the settings of your webview before you load the data:

WebSettings settings = mWebView.getSettings();
settings.setDefaultTextEncodingName("utf-8");
阅读全文

相关推荐

最新文章