You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2011/03/31 11:59:05 UTC

[jira] [Updated] (CMIS-344) Query parser should not use UTF-8 encoding

     [ https://issues.apache.org/jira/browse/CMIS-344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig updated CMIS-344:
-------------------------------

    Attachment: CMIS-344.patch

Proposed patch

> Query parser should not use UTF-8 encoding
> ------------------------------------------
>
>                 Key: CMIS-344
>                 URL: https://issues.apache.org/jira/browse/CMIS-344
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-server
>    Affects Versions: OpenCMIS 0.4.0
>            Reporter: Michael Dürig
>         Attachments: CMIS-344.patch
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira