I am trying to decode a name string which contains apostrophe. This name string is being parsed in an XML parser, so what I want to do is that the apostrophe should be displayed normally, rather than being displayed as '. I tried using the URLDecoder.decode(myString, "UTF-*"); to decode it but to no avail. From one solution posted on StackOverflow I found that we need to use the URLDecoder.decode() twice. However, even that is not working. The code that I am using is:
try {
temp = URLDecoder.decode("Wing's", "UTF-8");
nameOrg = URLDecoder.decode(temp, "UTF-8");
}
catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
At the end it should display Wing's as Wing's, but it is displaying the same string. Any help would be great. Thanks in advance.
Why don’t you just
decodeit usingHtml.fromHtml(String source),Output– Wing’s