Bugs item #887491, was opened at 2004-01-30 10:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=887491&group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Milen Dyankov (azzazzel)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem with non-English characters in UTF-8 encoded queries

Initial Comment:
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 '%ąężźćśłóń%'))
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"

 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=887491&group_id=22866


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to