logo       

AW: How to have an influence on the chosen "encoding": msg#00063

Subject: AW: How to have an influence on the chosen "encoding"
Yes that it, I was definitely not aware of
OutputStreamWriter.getEncoding()
 (and: that batik actually uses it)

thank you again

> -----Ursprüngliche Nachricht-----
> Von: Thomas E Deweese [mailto:thomas.deweese@xxxxxxxxx]
> Gesendet: Donnerstag, 12. Dezember 2002 16:09
> An: Batik Users
> Betreff: RE: How to have an influence on the chosen "encoding"
> 
> >>>>> "SM" == Steve Meyfroidt <steve.meyfroidt@xxxxxxxxxxxxxxxx>
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:klaus.mayr@xxxxxxxx] 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:steve.meyfroidt@xxxxxxxxxxxxxxxx] > 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:klaus.mayr@xxxxxxxx] > > Sent: Thursday, December 12, 2002
> >> 11:18 AM > > To: batik-users@xxxxxxxxxxxxxx > > 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: batik-users-unsubscribe@xxxxxxxxxxxxxx
> >> > > For additional commands, e-mail:
> >> batik-users-help@xxxxxxxxxxxxxx
> >> > >
> >> >
> >> >
> >>
---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx >
> >> For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx
> >>
> >>
> >>
> >>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx For
> >> additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx
> >>
> 
> SM>
---------------------------------------------------------------------
> SM> To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx For
> SM> additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xxxxxxxxxxxxxx
> For additional commands, e-mail: batik-users-help@xxxxxxxxxxxxxx


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe