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] New: - XmlTokenSource.save() does not use specified character encoding
Date Thu, 15 Jan 2004 01:18:24 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

           Summary: XmlTokenSource.save() does not use specified character
                    encoding
           Product: XMLBeans
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Binding
        AssignedTo: xmlbeans-dev@xml.apache.org
        ReportedBy: michael.gris@autodesk.com


Saving the in-memory XML via the .save(Writer w, XmlOptions options) method 
inherited from XmlTokenSource does not honour the specified character encoding.

Example:

{
    // ... code above

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

        // SERIALIZE THE RESPONSE OBJECT.
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        OutputStreamWriter osw = new OutputStreamWriter(bos, "ISO-8859-1");

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

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

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

    // ... code below


Always produces a document that is encoded in UTF-8 (xml header <?xml 
version="1.0" encoding="UTF-8"?>).

Incidentally, I haven't been able to find the list of character encodings that 
is supported by XMLBeans.

- ---------------------------------------------------------------------
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