>>>>> "SM" == Steve Meyfroidt <[EMAIL PROTECTED]> writes:

SM> The character encoding is done by the Writer as Batik pushes data
SM> into it.  Batik has nothing to do with the encoding... 

    I think she was essentially saying she didn't know there was the
OutputStreamWriter.getEncoding(), method that returns the encoding the
stream is using (so we can put it in the xml doctype processing
instruction).

SM> it's unfortunate that the Windows default encoding is something
SM> that no applications seem to understand! Perhaps the JVM should
SM> make UTF-8 a default regardless of the underlying platform.

    I think it's a hard tradeoff (UTF-8 is great for English (ASCII)
but I think that most European languages end up going to two bytes for
the 'special' chars).

>> -----Original Message----- From: Klaus Mayr
>> [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 1:15
>> PM To: 'Batik Users' Subject: AW: How to have an influence on the
>> chosen "encoding"
>> 
>> 
>> 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]
>> 

SM> ---------------------------------------------------------------------
SM> To unsubscribe, e-mail: [EMAIL PROTECTED] For
SM> additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to