Closed GoogleCodeExporter closed 9 years ago
This looks like the problem is in the XML parser and is probably out of my
control.
Are you able to provide a test file that contains one of these problematic
strings?
Original comment by paul.leb...@gmail.com
on 15 Jan 2014 at 2:02
Sorry about that, attached to this post is one of the files that threw the
error.
Original comment by MasterK...@gmail.com
on 15 Jan 2014 at 2:35
Attachments:
I played around with the SVG file today and confirmed that the issue is, as you
suggested, a problem with the XML parser itself and not AndroidSVG; I had the
same problem when I tried to use SVG-Android2 to display the file.
I used some Python to strip out the [kvg:element] attribute from the <g> nodes
in that 05e45.svg file and am pleased to report that the file loaded properly
with AndroidSVG. I imagine I'll be able to prevent these errors by running the
other SVG files through the script and strip out other such problematic
characters.
I suppose you can close this issue since the cause is unrelated to AndroidSVG.
Original comment by MasterK...@gmail.com
on 15 Jan 2014 at 10:14
The problematic sequence of bytes in question is f0 a0 92 8a.
The initial f0 byte indicates that it is a four byte encoding sequence. See
https://en.wikipedia.org/wiki/UTF-8 .
Unfortunately, it seems that the "Modified UTF8" encoding, that Java
implements, only supports up to 3 byte sequences. That's according to
http://docs.oracle.com/javase/6/docs/api/java/io/DataInput.html#modified-utf-8 .
Unfortunately I can't really intercept these strings before the XML parser
processes them, so it seems like the simplest solution is to do as you proposed
and strip the problematic attributes before passing them to AndroidSVG.
Original comment by paul.leb...@gmail.com
on 16 Jan 2014 at 12:08
Marking "Won't Fix"
Original comment by paul.leb...@gmail.com
on 16 Jan 2014 at 12:09
Actually, the SAX parser in Java likes it fine. I think it may be the one in
Harmony/Android that doesn't like four byte UTF-8 sequences. Doing some more
tests to confirm.
Original comment by paul.leb...@gmail.com
on 16 Jan 2014 at 4:57
Android bug report filed for this issue.
https://code.google.com/p/android/issues/detail?id=64892
Original comment by paul.leb...@gmail.com
on 16 Jan 2014 at 11:55
Original issue reported on code.google.com by
MasterK...@gmail.com
on 14 Jan 2014 at 11:06