Thank you, Steve, I'm confident that this will work.
I did not expect that Batik is able to find out, which arguments were passed to the OutputStreamWriter constructor. Klaus > -----Ursprüngliche Nachricht----- > Von: Steve Meyfroidt [mailto:[EMAIL PROTECTED]] > Gesendet: Donnerstag, 12. Dezember 2002 12:16 > An: Batik Users > Betreff: RE: How to have an influence on the chosen "encoding" > > That's the platform default encoding for stream Writers. The key is this > constructor of a OutputStreamWriter where you specify the encoding: > > OutputStreamWriter(System.out,"UTF8") > > > > > -----Original Message----- > > From: Klaus Mayr [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, December 12, 2002 11:18 AM > > To: [EMAIL PROTECTED] > > Subject: How to have an influence on the chosen "encoding" > > > > > > Hello * > > > > Generating SVG works properly at my place (Windows 2000) > > What I do is: > > > > ----------------------8<--------------------------------------------- > > import org.apache.batik.svggen.SVGGraphics2D; > > import org.apache.batik.dom.GenericDOMImplementation; > > import org.w3c.dom.Document; > > import org.w3c.dom.DOMImplementation; > > > > //... > > public static void toSVG(JGraph graph, Writer out) throws Exception { > > > > DOMImplementation domImpl = > > GenericDOMImplementation.getDOMImplementation(); > > // Create an instance of org.w3c.dom.Document > > Document document = domImpl.createDocument(null, "svg", null); > > // Create an instance of the SVG Generator > > SVGGraphics2D svgGenerator = new SVGGraphics2D(document); > > // Render into the SVG Graphics2D implementation > > graph.paint(svgGenerator); > > // Use CSS style attribute > > boolean useCSS = true; > > // Finally, stream out SVG to the writer > > svgGenerator.stream(out, useCSS); > > } > > > > ----------------------8<--------------------------------------------- > > > > What I get, is a properly good SVG file, but with an encoding > > such that > > it cannot be imported, neither into the ADOBE PlugIn of > > Mozilla nor into > > IE. > > > > The encoding is the following: > > > > <?xml version="1.0" encoding="Cp1252"?> > > > > How can I switch to another encoding before creating my file? > > (ISO-8859-1 works with ADOBE, but UTF8 does not work either) > > > > > > Klaus > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]