Tuesday, May 18, 2010

Re: [android-developers] How to handle accents in XML encoded as utf-8??

I always look at bits in the stream to debug UTF-8 encoding problems.
 
Although you said the encoding is UTF-8, you ought to specifically verify:
1) The encoding given in the HTTP response
2) The encoding given in the XML prologue
3) The encoding setting of the Reader underlying the XPP.

On Tue, May 18, 2010 at 3:00 AM, Samuh <samuh.varta@gmail.com> wrote:
I am parsing a RSS2.0 feed on Android using XML Pull Parser. The
encoding for the XML is set as UTF-8. The parser fails giving invalid
token exception.

When I save the received XML feed file and open it in the
browser(FireFox), the browser cannot render the XML and spits out an
"Invalid token(unicode 0x12) exception".

XML(encoded with UTF-8) does not recommend such characters but
assuming that I don't have any control over the XML file being
received, how do I handle such cases?

Please help.

Thanks.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment