Wednesday, May 19, 2010

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

Well, we got the easy things out of the way. The error message you get is "Invalid token(unicode 0x12) exception". It would be very helpful if you post or send me the URL. As I mentioned, I've found debugging encoding issues more productive at the binary level.
 
Just as a wild guess, I'm expecting to see a 0x12 preceded by say 0xEB. The 0xEB may be UTF-8 or Latin-1. However the UTF decoder would expect the following byte with the most significant bit set (0x80 - 0xBF), If I can see the binary, I'm sure I can figure it out. Maybe you can too.
 
On Tue, May 18, 2010 at 9:04 PM, Samuh <samuh.varta@gmail.com> wrote:
Thanks for your reply Frank.

>>1) The encoding given in the HTTP response
The charset of the response is UTF-8

>>2) The encoding given in the XML prologue
XML prolog says UTF-8

>>3) The encoding setting of the Reader underlying the XPP.
When doing a setInput on the parser I said:
parser.setInput(inputStream,"utf-8");

I also tried constructing a reader with utf-8 encoding but without
much luck.
InputStreamReader reader = new InputStreamReader(inputStream,"utf-8");
parser.setInput(reader);

I really am stuck in this rut not sure of what to do.

Please help...

--
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