Uploaded image for project: 'Chemistry'
  1. Chemistry
  2. CMIS-377

Characters encoding issue when using Atom binding

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: OpenCMIS 0.3.0
    • Fix Version/s: OpenCMIS 0.4.0
    • Component/s: opencmis-server
    • Labels:
      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.

        Attachments

          Activity

            People

            • Assignee:
              fmui Florian Müller
              Reporter:
              cmoitrier Cedric Moitrier
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: