I use the following code to encode an html file that is located in my resource folder. I went through various links here, but was not successful. Here is my code snippet.
WebSettings settings = myWebVeiw.getSettings();
//settings.setJavaScriptEnabled(true);
//myWebVeiw.getSettings().setJavaScriptEnabled(true);
settings.setDefaultTextEncodingName("utf-8");
//settings.setDefaultTextEncodingName("ISO-8859-1");
myWebVeiw.loadUrl("file:///android_asset/"+totaldays+".html");
Although it works for other characters, it cannot code as it prints the same in a web view. Please suggest me what to do.
Any help would be appreciated.
source
share