commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Ho" <>
Subject betwixt BeanWriter charset encoding
Date Fri, 11 Apr 2003 17:36:27 GMT
I posted this to the Commons user list and got no reponse. Maybe someone 
here can help?

Why is there no method in the BeanWriter class to set the charset encoding 
for the XML stream to be written?

I looked at the source and the the only use of OutputStreamWriter (when 
using BeanWriter with an OutputStream) is with the single argument 
OutputStreamWriter constructer which uses the default character encoding.

public BeanWriter(OutputStream out) {
   this.writer = new BufferedWriter( new OutputStreamWriter( out ) );

OutputStreamWriter(OutputStream out)
OutputStreamWriter(OutputStream out, String charsetName) // overload
// to use this version?

There is a method that let's you set the encoding attribute in the XML 
declaration, but not one to set the 'actual' encoding. Therefore there would 
be a mismatch if you set the XML declaration encoding attribute to anything 
other than the default character encoding of your JVM.

Add photos to your messages with MSN 8. Get 2 months FREE*.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message