-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Character set, collation
PostPosted: Sat Nov 19, 2011 4:14 am 
Newbie

Joined: Sat Nov 19, 2011 4:07 am
Posts: 2
Hello everybody,

My query doesn't differentiate between words which contains accents.

select * from words where word = 'cipö'

The result contain word 'cipö' and 'cipó' too!

I tried the following query
select * from words where BINARY word = 'cipö'

It works perfectly but the Hibernate doesn't known this operator 'BINARY'
http://webcache.googleusercontent.com/search?q=cache:kQlGe7eFbPAJ:dev.mysql.com/doc/refman/5.0/en/charset-binary-op.html+MySql+select+where+binary&cd=1&hl=hu&ct=clnk&gl=hu

How can I resolve this problem?
how can I force the Hibernate comparison to byte by byte?

Thanks.


Top
 Profile  
 
 Post subject: Re: Character set, collation
PostPosted: Mon Nov 21, 2011 7:23 pm 
Newbie

Joined: Sat Nov 19, 2011 4:07 am
Posts: 2
ujtordai wrote:
How can I resolve this problem?
Thanks.

By my humble opinion here is the possible way to resolve this problem.
The following settings need to put into my.ini
[mysqld]
init_connect='SET collation_connection = utf8_hungarian_ci'
init_connect='SET NAMES utf8'
character-set-filesystem=utf8
character-set-server=utf8
collation-server=utf8_hungarian_ci
skip-character-set-client-handshake

After need to modify the collation of database:
ALTER DATABASE dict CHARACTER SET utf8 COLLATE utf8_hungarian_ci;
All content is need to exists in the selected character set,therefore I needed to convert it to desired character set, in this case utf8_hungarian_ci
ALTER TABLE words CONVERT TO CHARACTER SET utf8 COLLATE utf8_hungarian_ci;
Of course not need the BINARY option after WHERE keyword.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.