I'm using some webviews in my android app, but are unable to make them display in utf-8 encoding.
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);
Regards
You can try to edit the settings of your webview before you load the data:
WebSettings settings = mWebView.getSettings(); settings.setDefaultTextEncodingName("utf-8");
Also, as provided in the comment below, be sure to add "charset=utf-8"
to the loadData call:
mWebView.loadData(getString(R.string.info_texto), "text/html; charset=utf-8", "utf-8");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With