commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Ho" <>
Subject betwixt BeanWriter charset encoding
Date Thu, 10 Apr 2003 23:35:05 GMT
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 charcater encoding of your JVM.

The new MSN 8: advanced junk mail protection and 2 months FREE*

View raw message