android - Why doesn't Webview display strings other than in English? -
i have used following code display string in android webview:
webview.loaddata(anenglishstring + "<br />" + apersianstring, "text/html", "utf-8");
also note tried substitute "utf-8" with: "unicode", "utf8", "utf-16", "ansi", ... each time got following output in webview:
this message in english
%%#:-=%@+=%-#@##%@%
by way, tried use:
webview.loaddatawithbaseurl(null, ..., null);
as as:
webview.getsettings().setdefaulttextencoding();
but i'm still getting same wired characters persian message.
i used following code solve problem:
webview.loadurl("data:text/html;charset=utf-8," + nonenglishstring);
Comments
Post a Comment