[jdom-interest] Unexpected encoding in XMLOutputter

Wolfgang Werner wwerner at picturesafe.de
Wed Sep 29 11:04:51 PDT 2004

Hi there,

my code inside a jsp should give me an ISO-8859-1 encoded stream:

Document result = <construct a document here>;


XMLOutputter xout = new XMLOutputter( Format.getPrettyFormat());
xout.getFormat().setEncoding( "ISO-8859-1" );

// xout.output( result, System.out );
xout.output( result, response.getOutputStream() );

But what I get is always UTF-8 encoded.

I know that that representation is from a xml point of view perfectly  
legal - but I need
an ISO-8859-1 encoded result (for customer reasons...)

Please let me know if this is the intended behavior or if it's a bug.
I'm using jdom 1.0

Best regards,


More information about the jdom-interest mailing list