I have a webview and am trying to load simple UTF-8 text into it.
mWebView.loadData("將賦予他們的傳教工作標示為", "text/html", "UTF-8");
But the WebView displays ANSI/ASCII garbage.
Obviously an encoding issue, but what am I missing in telling the webview to display the Unicode text?
This is a HelloWorld app.
Use:
or using WebSettings with setDefaultTextEncoding:
For recent versions of Android, API 16 to 22 it was tested and work properly using loadData() method, requires the mimeType to include: “charset=utf-8”.
or