5

I have an info.html for my App which is in a webview. info.html is encoded with UTF-8.

I want talkback to vocalize the text in it however it fails in some non-english characters.

String infoURL = "file:///android_asset/info.html";
WebView view  =  (WebView) theAct.findViewById(R.id.webview);
view.loadUrl(infoURL);

I used also this, which failed:

String infoURL = "file:///android_asset/info.html";
WebSettings settings = view.getSettings();
settings.setDefaultTextEncodingName("utf-8");
view.loadUrl(infoURL);

or:

...
view.loadDataWithBaseURL(infoURL, null, "text/html", "utf-8",null);
ArdaA
  • 137
  • 5

1 Answers1

0

Make sure the file itself is saved as UTF-8, sometimes is not sufficient to specify

<meta charset="utf-8"> 

inside html file

Pipe
  • 2,379
  • 2
  • 19
  • 33