Coder Social home page Coder Social logo

illegal start byte 0xf0 about androidsvg HOT 7 CLOSED

m1cha avatar m1cha commented on July 21, 2024
illegal start byte 0xf0

from androidsvg.

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
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 [email protected] on 15 Jan 2014 at 2:02

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
Sorry about that, attached to this post is one of the files that threw the 
error.

Original comment by [email protected] on 15 Jan 2014 at 2:35

Attachments:

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
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 [email protected] on 15 Jan 2014 at 10:14

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
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 [email protected] on 16 Jan 2014 at 12:08

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
Marking "Won't Fix"

Original comment by [email protected] on 16 Jan 2014 at 12:09

  • Changed state: WontFix

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
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 [email protected] on 16 Jan 2014 at 4:57

from androidsvg.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 21, 2024
Android bug report filed for this issue.

https://code.google.com/p/android/issues/detail?id=64892

Original comment by [email protected] on 16 Jan 2014 at 11:55

from androidsvg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.