Uploaded image for project: 'XML-RPC'
  1. XML-RPC
  2. XMLRPC-91

MinML does not handle XML encoding properly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When you implement your own XML-RPC transport layer and call

      XmlRpcServer.execute(InputStream in, XmlRpcContext context);

      the following happens:

      First, XmlRpc.parse(InputStream is) calls MinML.parse(new InputSource(is).

      Then, MinML.parse(...) calls parse(new InputStreamReader(source.getByteStream()));

      which is wrong: this parses the stream with the platform default encoding, regardless of the actual encoding used in the XML stream, destroying, eg, UTF-8 encoded characters on Windows.

      Together with #XMLRPC-90, XmlRpc could be changed to use the Java 1.4 oder 1.5 platform XML parser which respect handle streams correctly and use any encoding declaration embedded in the XML stream.

      Workaround: Use XmlRpc.setDriver("xerces") and add xercesImpl.jar to the classpath.

        Activity

        Hide
        jochen@apache.org Jochen Wiedmann added a comment -

        Another workaround might be to ensure that the server doesn't use Non-ASCII characters by using the ASCII encoding when sending the documents.

        Given the fact that MinML is practically obsolete with version 3, I'd like to close this issue with WONTFIX. I'll leave the request open for some weeks in case some other developer steps forward and volunteers to create a patch.

        Show
        jochen@apache.org Jochen Wiedmann added a comment - Another workaround might be to ensure that the server doesn't use Non-ASCII characters by using the ASCII encoding when sending the documents. Given the fact that MinML is practically obsolete with version 3, I'd like to close this issue with WONTFIX. I'll leave the request open for some weeks in case some other developer steps forward and volunteers to create a patch.
        Hide
        jschwarze Jochen Schwarze added a comment -

        You cannot normally influence the XML encoding that a client uses to conact your server, so that's no workaround IMO.

        But here's another workaround, this time without Xerces in the classpath:

        XmlRpc.setDriver(org.xml.sax.helpers.XMLReaderAdapter.class);

        No need for a patch to MinML on my side.

        Jochen

        Show
        jschwarze Jochen Schwarze added a comment - You cannot normally influence the XML encoding that a client uses to conact your server, so that's no workaround IMO. But here's another workaround, this time without Xerces in the classpath: XmlRpc.setDriver(org.xml.sax.helpers.XMLReaderAdapter.class); No need for a patch to MinML on my side. Jochen
        Hide
        jochen@apache.org Jochen Wiedmann added a comment -

        As indicated by the user, there is no need to change this.

        Show
        jochen@apache.org Jochen Wiedmann added a comment - As indicated by the user, there is no need to change this.

          People

          • Assignee:
            Unassigned
            Reporter:
            jschwarze Jochen Schwarze
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development