I have a PostgreSQL database with some Unicode values. For example "vaishali" in Marathi. I want to fire a query SELECT * FROM table WHERE name LIKE vaishali
(I type "vaishali" in Marathi, so I first convert to unicode in my prog). But it matches nothing. Why?
views:
78answers:
1
A:
There are two possible causes for this problem:
The JDBC driver is not instructed to use UTF-8. This would actually be a bug, because it's supposed to automatically pickup the correct character encoding from the DB metadata. To my experience, the PostgreSQL JDBC drivers have always done a good job in this.
The SQL query is actually wrongly constructed/formulated. The one which you've posted is already syntactically invalid. Please post the actual code and query. Also, you seem to insist that it only happens with a
LIKE
query. How about a normalWHERE name = 'foo'
query?
BalusC
2010-03-02 12:40:54