Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
OpenCMIS 0.3.0
-
None
Description
Atom binding does not properly handle characters encoding in HTTP responses.
Actually, the XMLOutputStream is created using the following piece of code:
<pre>
XMLOutputFactory factory = XMLOutputFactory.newInstance();
fWriter = factory.createXMLStreamWriter(out);
fWriter.writeStartDocument();
</pre>
which is located in org.apache.chemistry.opencmis.server.impl.atompub.XMLDocumentBase#startDocument(OutputStream).
In order for the encoding in the XML header to match the actual characters encoding, this should be replaced by:
<pre>
XMLOutputFactory factory = XMLOutputFactory.newInstance();
fWriter = factory.createXMLStreamWriter(out, encoding);
fWriter.writeStartDocument(encoding, "1.0");
</pre>
The output encoding can be obtain from the HTTP request.