Chemistry
  1. Chemistry
  2. CMIS-344

Query parser should not use UTF-8 encoding

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: OpenCMIS 0.4.0
    • Fix Version/s: OpenCMIS 0.4.0
    • Component/s: opencmis-server
    • Labels:
      None

      Description

      QueryUtil converts the query statement to a UTF-8 encoded byte array which is used as input to the lexer instead of using the string directly.

      Instead of

      CharStream input = new ANTLRInputStream(new ByteArrayInputStream(statement.getBytes("UTF-8")));

      the input stream should be obtained like this:

      CharStream input = new ANTLRStringStream(statement);

      The former method transforms the characters in the contains clause of the query

      SELECT * FROM cmis:document WHERE CONTAINS ('\u4E2D\u6587')

      in an incorrect way.

      1. CMIS-344.patch
        2 kB
        Michael Dürig

        Activity

        Michael Dürig created issue -
        Hide
        Michael Dürig added a comment -

        Proposed patch

        Show
        Michael Dürig added a comment - Proposed patch
        Michael Dürig made changes -
        Field Original Value New Value
        Attachment CMIS-344.patch [ 12475082 ]
        Jens Hübel made changes -
        Assignee Jens Hübel [ jenshuebel ]
        Hide
        Jens Hübel added a comment -

        Patch applied. Thanks for providing it.

        Show
        Jens Hübel added a comment - Patch applied. Thanks for providing it.
        Jens Hübel made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s OpenCMIS 0.4.0 [ 12316316 ]
        Resolution Fixed [ 1 ]
        Jens Hübel made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Jens Hübel
            Reporter:
            Michael Dürig
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development