How to remove accent characters from an InputStream
Posted
by Samuh
on Stack Overflow
See other posts from Stack Overflow
or by Samuh
Published on 2010-05-18T09:29:12Z
Indexed on
2010/05/18
9:30 UTC
Read the original article
Hit count: 480
I am trying to parse a Rss2.0 feed on Android using a Pull parser.
XmlPullParser parser = Xml.newPullParser();
parser.setInput(url.open(), null);
The prolog of the feed XML says the encoding is "utf-8". When I open the remote stream and pass this to my Pull Parser, I get invalid token, document not well formed exceptions.
When I save the XML file and open it in the browser(FireFox) the browser reports presence of Unicode 0x12 character(grave accent?) in the file and fails to render the XML.
What is the best way to handle such cases assuming that I do not have any control over the XML being returned?
Thanks.
© Stack Overflow or respective owner