Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-859

Problem with non-English characters in UTF-8 encoded queries

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • JBossAS-3.2.6 Final
    • CMP service
    • None

    Description

      SourceForge Submitter: azzazzel .
      It seems that all characters coded with more than one
      byte (2+ bytes) in UTF-8 encoded queries are
      incorrectly parsed by [EJB/JBoss]QLParser as seen in
      this log fragment:

      ...
      2004-01-20 09:21:44,507 DEBUG
      plugins.cmp.jdbc.JDBCDynamicQLQuery.Company#ejbSelectGeneric
      DYNAMIC-QL: SELECT OBJECT(c) FROM Company c WHERE
      ((c.name LIKE '%|z[B??????????????????????????????????????????????????????D%'))
      2004-01-20 09:21:44,510 DEBUG
      plugins.cmp.jdbc.JDBCDynamicQLQuery.Company#ejbSelectGeneric
      SQL: SELECT t0_c.symbol_ FROM COMPANY_ t0_c WHERE
      (((t0_c.name_ LIKE '%|z[B??????????????????????????????????????????????????????D%')))
      2004-01-20 09:21:44,510 DEBUG
      plugins.cmp.jdbc.JDBCDynamicQLQuery.Company#ejbSelectGeneric
      Executing SQL: SELECT t0_c.symbol_ FROM COMPANY_ t0_c
      WHERE (((t0_c.name_ LIKE '%|z[B??????????????????????????????????????????????????????D%')))
      ...

      I don't know much for JJTree but I feel these two
      parameters:
      UNICODE_INPUT = false;
      JAVA_UNICODE_ESCAPE = true;
      in "JBossQLParser.jjt" and "EJBQLParser.jjt" files are
      responsible for this behaviour! I guess due to the way
      the are set [EJB/JBoss]QLParser expects queries to be
      non-Unicode encoded (1 character - 1 byte) with
      characters not defined in current character set in
      Unicode-escaped format (\uXXXX).
      If I pass parameter like '\u0105' instead of '' then
      it works.

      Simply setting JAVA_UNICODE_ESCAPE = false;
      reverses the situation. I beleive this is supposed to
      be the default. I have not checked if queries in other
      encodings (like ISO-8859-X) work with this
      configuration, but I don't see a reason why they should
      not!

      Tested on:
      JBoss 3.2.1, 3.2.2 and 3.2.3
      JVM 1.4.1_02 and 1.4.2_03
      OS: Linux 2.4.22 and Widows 2000/XP

      JBoss was started with "-Dfile.encoding=UTF-8"

      Attachments

        Activity

          People

            olubyans@redhat.com Alexey Loubyansky
            sourceforge-user SourceForge legacy user (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: