xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martynas Lelevicius" <ma...@nomagic.com>
Subject Re: Encoding missmatch problem
Date Mon, 07 Oct 2002 16:07:24 GMT

I attached the sample java source and the svg image file.
Try to run sample and you'll get exception:
java.io.IOException: Declared encoding "ISO-8859-1" does not match actual
one "UTF8"; this might not be an error.
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
        at SvgTest.main(SvgTest.java:18)

Interesting that changing encoding to "UTF-8" doesn't help, only if encoding
is is set to "UTF8" or removed at all exception does not occurs.


----- Original Message -----
From: "Thomas E Deweese" <thomas.deweese@kodak.com>
To: "Batik Users" <batik-users@xml.apache.org>
Sent: Monday, October 07, 2002 13:46
Subject: RE: Encoding missmatch problem

> >>>>> "ML" == Martynas Lelevicius <marte@nomagic.com> writes:
> ML> Hi, I try to create SVGOMDocument from the SVG file:
> ML> <...> SAXSVGDocumentFactory df = new SAXSVGDocumentFactory(...);
> ML> SVGOMDocument doc = df.createDocument(uri, inputStreamReader);
> ML> <...>
> ML> If the encoding declared in SVG (xml) file does not match
> ML> InputStreamReader used encoding exception occurs:
> ML> java.io.IOException: Declared encoding "ISO-8859-1" does not match
> ML> actual one "UTF8"; this might not be an error.  at
> ML> org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown
> ML> Source) at
> ML> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
> ML> Source) <...>
> ML> How can I avoid this?
>     This isn't my area of expertese, but it looks to me like the
> InputSource was created incorrectly or the SVG file was created
> incorrectly (I believe UTF8 files can have a 'magic number' that
> starts them, it's possible that the XML parser picks this up and then
> notices that this doesn't match the encoding declared in the file it's
> self, the '<?xml version="1.0" ...>' tag).
>     I've never seen this error myself, so it isn't a FAQ, and you
> didn't really give a lot of information to go on (the SVG file would
> be useful - putting it in a zip archive would help ensure it's
> encoding didn't get munged during transport, and a complete stack
> trace with line numbers would probably also help - to see where the
> InputSource is being created).
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org

View raw message