I have a WebView where I’m loading a string from a database. In that string there’s a ½ character and when I go to look at it on my devce it’s showing up as Ȃ½. I tried using utf-8 and also unicode. I also tried searching for the Ȃ using Java string replace and replacing it with “”, but it didn’t work.
String description = "½";
WebView webview = (WebView) findViewById(R.id.webview);
webview.loadData(description, "text/html", "utf-8");
The string provided to loadData() is loaded via a ‘data: URL’ and so needs
to be URL-Encoded
Credit: this via Matt Murphy (CommonsGuy).