Comments (7)
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.
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.
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.
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.
Marking "Won't Fix"
Original comment by [email protected]
on 16 Jan 2014 at 12:09
- Changed state: WontFix
from androidsvg.
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.
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)
- FAQ promotes extremely bad backward-compatibility practice HOT 6
- Image references missing SVG support. HOT 3
- Canvas changed after renderToCanvas HOT 1
- Position of Rectf ignored when renderToCanvas HOT 1
- Support for hardware acceleration
- Android version support HOT 1
- Android version support HOT 1
- Pattern fills are rendered with visible grid HOT 4
- Provide copy constructor or allow rendering to multiple viewBox at once HOT 3
- migrate the repository HOT 3
- Move project to Github HOT 1
- NullPointerException in 1.2.2-beta1 when parsing SVG document HOT 4
- SVGImageView crashes on Android 5.0 and higher HOT 5
- Proguard breaks reflective CSS selectors HOT 1
- java.lang.ArrayIndexOutOfBoundsException: length=0; index=-2 in SVGAndroidRenderer.arcTo(SourceFile:2572) HOT 1
- Incorrect rendering of SVG image HOT 5
- Unable to execute dex: Multiple dex files define HOT 1
- About License HOT 1
- Export to GitHub HOT 3
- Not able to detect the individual element click
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidsvg.