xml-xmlbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 26146] - XmlTokenSource.save() does not use specified character encoding
Date Thu, 15 Jan 2004 18:20:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26146>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26146

XmlTokenSource.save() does not use specified character encoding





------- Additional Comments From michael.gris@autodesk.com  2004-01-15 18:20 -------
Ammendment to original comments.  When I do not use the OutputStreamWriter and 
only save with the ByteArrayOutputStream, then the specified character encoding 
is honoured. I am happy that I found a workaround, but am still wondering why it 
didn't work with the Writer.

{
    // ... code above

        // GENERATE THE RESPONSE OBJECT.
        XLSType responseXLS = processXLSDocument(requestXLS, 
globalRequestContext);

        // SERIALIZE THE RESPONSE OBJECT.
        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        // Serialize the response.
        xlsDoc = XLSDocument.Factory.newInstance();
        xlsDoc.setXLS(responseXLS);

        opts = new XmlOptions();
        opts.setCharacterEncoding("ISO-8859-1");
        opts.setUseDefaultNamespace();
        opts.setSaveAggresiveNamespaces();

        xlsDoc.save(bos, opts);
        bos.flush();
        bos.close();

    // ... code below
}

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message