1

i am trying to display html in webview but problem is it is showing euro sign instead of '

when i look at html by debugging it shows everything fine but not in webview. any one guide me what is the solution to this problem?

my code

enter image description here

_webView.getSettings().setJavaScriptEnabled(true);
        _webView.getSettings().setPluginsEnabled(true);

            _webView.loadData(_urlfromSummarie, "text/html", "UTF-8");

any help would be appreciated.

UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278

2 Answers2

5

You need to add a declaration in the document itself, for example:

<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
...

Also, LoadDataWithUrl is generally better than loadData, it doesn't require URLEncoder.encode (slow), and doesn't keep a long data url in the webview's history memory.

NoBugs
  • 9,310
  • 13
  • 80
  • 146
0

Looks like your UTF-8 text is being rendered as plain ASCII-- does "UTF-8" in the encoding parameter need to be lowercase? It's lowercase in the API documentation.

JonathonW
  • 857
  • 7
  • 17