Skip to content Skip to sidebar Skip to footer

Android Parse Special Characters In Json Response

In my Android application I get JSON response string from a PHP url. from the response I get some hotel names with apostrophe, I get ' character instead of apostrophe. How

Solution 1:

Use the decoder instead of encoder. URLDecoder.decode(jresponse,"UTF-8")

Solution 2:

Use ISO-8859-2 when you create the URLEncodedEntity that you send off. You can set this as a parameter in the constructor.

Without a specified charset, you are probably sending the data in UTF-8/UTF-16 (most common) which the server is interpreting in a different way.

EDIT: It looks like ISO-8859-2 doesn't support ñ. You may have to change something server-side. http://en.wikipedia.org/wiki/ISO/IEC_8859-2

Solution 3:

You can try Html class. eg :- jresponse = Html.fromHtml(jresponse);

Post a Comment for "Android Parse Special Characters In Json Response"