-->
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: Problem with German Umlauts and Restriction.like
PostPosted: Mon Aug 11, 2008 12:27 pm 
Newbie

Joined: Wed May 07, 2008 2:19 am
Posts: 2
I searched the forum but didn't find a solution, or the suggestions I found don't work:

I have a website with UTF-8 encoding, I have a search form to enter a query. The database in the back is Postgres8.x with a UTF-8 database. Loading and storing data with German Umlauts works fine, but I have trouble with the search using Restrictions.like.

My database url - I added characterEncoding param:
Code:
<property name="jdbcUrl"><value>jdbc:postgresql://server:5432/dbname?characterEncoding=UTF-8</value></property>


As hibernate property, I added:
Code:
<prop key="hibernate.connection.lc_type">UTF-8</prop>


I want to search using Restrictions.like, so I have:
Code:
.add(Restrictions.like("office.title", this.query.toLowerCase(),MatchMode.ANYWHERE).ignoreCase())


Now I try to search for the word 'südpfalz', which definitely exists in the database, but hibernate doesn't find it. Searching only for 'pfalz' finds the result.
There is something wrong with the umlaut ü. But as far as I can see from my log file, when I output the Criteria, the encoding seems to be alright so far. But the search just doesn't give a result.

This is the logged criteria:
Code:
<Values (DetachableCriteria(CriteriaImpl(com.company.model.realty.LocalizedRealtyData:this[Subcriteria(realty:realty), Subcriteria(realty.office:office)][locale=de, (), (office.title like %südpfalz% or realty.no like %südpfalz% or title like %südpfalz%)])))>


I also updated to the latest postgres-jdbc-driver 8.3.603 and hibernate 3.2.

Last I tried to set the file.encoding to UTF-8 (in the jsp of the search form though - but with that it's set for the entire JVM then), but no difference.

Does anyone know this behaviour?


Top
 Profile  
 
 Post subject: Re: Problem with German Umlauts and Restriction.like
PostPosted: Tue Jun 08, 2010 8:54 am 
Newbie

Joined: Tue Jun 08, 2010 8:49 am
Posts: 2
I have the same problem!!!!

Why is nobody answering???


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.