Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Java-SDO-1.1
-
None
-
doesn't matter
-
Patch Available
Description
xmlHelper provide some save method which could save dataobject to string or save XmlDocument to Writer. while using these method to save xml, TuscanySDO always assume the system's default encoding is same as XMLDocument 's encoding. If they are not same, the saved xml will contains invalid chracter for multi-byte character(etc chinese).
To correct this bug is very simple. just change the org.apache.tuscany.sdo.helper.XMLDocumentImpl 's save method:
protected void save(Writer outputWriter, Object options) throws IOException
{ // TODO temporary brute-force implementation ... to be replaced ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); save(outputStream, options); <<<<<<<<<<<<<<<< // outputWriter.write(new String(outputStream.toByteArray()); >>>>>>>>>> outputWriter.write(new String(outputStream.toByteArray(), this.getEncoding()); }