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

Characters encoding issue when using Atom binding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • OpenCMIS 0.3.0
    • OpenCMIS 0.4.0
    • opencmis-server
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: