0

I saw a lot of post and suggestions saying to use "utf-8", and I am using it but getting some extra characters in the web view.The extra characters can be seen in the image

mWebView.loadDataWithBaseURL("file://" + file1, htmltext, "text/html", "utf-8", null);

I also tried

WebSettings settings = mWebView.getSettings();             
settings.setDefaultTextEncodingName("utf-8");
Wasi Ahmad
  • 35,739
  • 32
  • 114
  • 161
user3507451
  • 39
  • 1
  • 10
  • http://stackoverflow.com/a/10831462/3395198 – IntelliJ Amiya Mar 18 '17 at 07:54
  • 1
    My code is similar to the answer code given there // Will render correctly webView.loadDataWithBaseURL(null, scandinavianCharacters, "text/html", "UTF-8", null); but it is not working @IntelliJ Amiya – user3507451 Mar 18 '17 at 08:03
  • have you tried this webView.loadDataWithBaseURL(null, "file:///android_asset/home.html", "text/html", "utf-8",null); – Ramesh R Mar 18 '17 at 08:21
  • getting a compilation error @RameshR for first and last null and also I tried it just with the html string but getting the same result. mWebView.loadDataWithBaseURL(null, htmltext, "text/HTML", "utf-8",null); – user3507451 Mar 18 '17 at 08:27

0 Answers0