Problem with string comparison when using utf8
Posted by: Vassilis Zafeiris
Date: July 21, 2005 06:46AM

Hi to everyone,
I would appreciate If anyone could help me with this problem:

I have a table with default character set utf8 named AC_LIC_G.
In this table I have two columns with character set utf8 and collation utf8_general_ci (their names PREFECTURE, MUNICIPALI)

In the columns I store greek characters that by the way I can't see from the query browser:) Nevermind...

I connect to the database with JDBC/Connector/J with the following connect string:

jdbc:mysql://localhost:3306/ac_lic_gis?characterEncoding=UTF-8&user=root&password=pass

when I execute the query "SELECT PREFECTURE FROM AC_LIC_G ORDER BY PREFECTURE"
everything is OK, I get my results and I can see them in the client.

But whenever I try to restrict my selection e.g. with queries:

SELECT MUNICIPALI FROM AC_LIC_G WHERE PREFECTURE='Αρτας'

I get no results even though there are records in the table.
Even queries such SELECT MUNICIPALI FROM AC_LIC_G WHERE PREFECTURE like '%α%'
(note that α is a very common letter in the greek alphabet) don't return anything.

Do you have any idea what is happening?

Thank you in advance
Vassilis Zafeiris

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem with string comparison when using utf8
3468
July 21, 2005 06:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.