Suppry
Suppry

Reputation: 81

UTF8 issue in Android webView.loadUrl

My webpage is working in all brwosers including iOS devices.But I use same page in Android app webview the characters are blank.

Original characters: "à´•à´°àµà´£à´¯à´±àµà´± ; നിസàµà´¨àµ‡à´¹à´®à´¾à´¯ ; à´¸àµà´¨àµ‡à´¹à´®à´¿à´²àµà´²à´¾à´¤àµà´¤"

After I use - meta http-equiv="Content-Type" content="text/html; charset=utf-8" its showing correct words in local language [കരുണയറ്റ ; നിസ്നേഹമായ ; സ്നേഹമില്ലാത്ത] but the same webpage not shoing in android webView.loadUrl.

Upvotes: 2

Views: 7946

Answers (2)

Dipen
Dipen

Reputation: 1064

Hey i suggest all of you facing unicode problem to test your app on real device mine was not working on emulator but when i tested on real device my app loaded all the unicode fonts may be sound silly but it really worked for me.Here are my codes

WebSettings settings = webView.getSettings();
settings.setDefaultTextEncodingName("utf-8");
webView.loadUrl("http://kpbhandari.info/");

Upvotes: 3

Ahmad
Ahmad

Reputation: 72553

Try using this istead of webView.loadUrl(...):

webView.loadDataWithBaseURL(null, "yourWebPage ", "text/html", "utf-8", null);

or try this:

WebSettings settings = webView.getSettings();
settings.setDefaultTextEncodingName("utf-8");

Upvotes: 12

Related Questions