This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: question with xalan, java, utf8


> I'm trying to output HTML using UTF-8 characters. When I use Instant
> Saxon with my xml and xsl file, all if well. But if I try to do this
> through Java I've had multiple problems!
>
> FileWriter output = new FileWriter("/tmp/testlog");
>
When you provide a Writer as the output destination, Saxon simply writes
characters to the Writer. The Writer itself translates these into bytes,
using whatever encoding it decides is apppropriate. If you want to control
the encoding from the stylesheet, you must supply an OutputStream, not a
Writer - that way it's Saxon's job to convert characters to bytes, not
Java's.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]