Take the 2-minute tour ×

I am creating an Android application for my website. Basically I am fetching content of individual posts and showing in the WebView. Everything is fine except the weird � symbols.

I am using the following code to display the html in the webview:

WebView myWebView = (WebView) findViewById(R.id.webView1);

I have also tried using WebView#loadData() but that does not help. Please have a look at the screenshot which will explain the problem precisely.

What can be the problem? Is this some sort of encoding problem?

Any help will be highly appreciated.


share|improve this question
'�` is U+FFFD, REPLACEMENT CHARACTER. I'm not sure what would make it appear. –  Keith Thompson Jul 23 '12 at 18:20
More information on this character here. Rather than trying to replace it with the empty string, I suggest figuring out why it's there in the first place, and fixing that problem. I don't know enough about WebView to offer more advice. For example, in "it�s", the character probably replaces an apostrophe -- but the grammatically correct word is "its", not "it's" (possessive, not a contraction of "it is"). The others are likely quotation marks U+2019 and U+201A; if you can't display those, you can use U+0022 ". –  Keith Thompson Jul 23 '12 at 19:48
The encoding of the text passed to [loadDataWithBaseURL](developer.android.com/reference/android/webkit/…, java.lang.String, java.lang.String, java.lang.String, java.lang.String)) is not utf8, either convert it to utf-8 or change the encoding option to that of the text –  Musa Jul 24 '12 at 2:13
The problem is now solved. I used: text.replaceAll("\\uFFFD",""); –  Sandeep Panda Jul 24 '12 at 8:14

Your Answer



Browse other questions tagged or ask your own question.