-->
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.  [ 6 posts ] 
Author Message
 Post subject: Using unicode encoded text and MySql server
PostPosted: Tue Apr 19, 2005 12:13 pm 
Newbie

Joined: Wed Mar 02, 2005 6:28 pm
Posts: 13
Sorry for coping my post, but I think my previows topic wasn't accurate

Name and version of the database I am using: Mysql 4.1.11

The problem is that when I try to fetch data from the Mysql server I get only garbidge considered that the data is (cyrilic charakters - unicode encoded utf8).
Code:
<property name="hibernate.connection.url"> jdbc:mysql://192.168.11.89/wfms</property>
<property name="hibernate.connection.useUnicode">true</property>
<property name="hibernate.connection.charSet">utf-8</property>

Well, I have a running Web application but I need a cyrilic support. However I could not supply it at this time. I've set utf-8 charEncoding on all my jsp documents. Also, as could be seen on the part of my hibernate.cfg.xml file I've added params to use utf-8 with jdbc connections. Moreover my tables are with default character set - utf8. I read all the related documentation I managed to find.

I'm out of ideas. Please give me some help if possible


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 11:03 am 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
I am having the same problem with arabic language support. My database (mysql) collation is set to utf8_bin and my default charset is: utf8.

When I set string attributes in arabic and persist them, they get transformed to question marks (???).

Did you solve your problem?

Thanks in advance.

_________________
Vincent Giguère
J2EE Developer


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 11, 2005 11:12 pm 
Newbie

Joined: Thu Oct 16, 2003 3:26 pm
Posts: 12
I'm not sure what application server you're using, but try passing -Dfile.encoding=UTF-8 to it when you launch it. I spent about 8 hours today trying to get this working and that was the solution (I'm using Orion 2.0.5).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 3:34 am 
Beginner
Beginner

Joined: Mon Sep 12, 2005 3:27 am
Posts: 48
Full acknowledge. Same Solution on some systems with the JBOSS Application Server. If you must append the -Dfile.encoding=UTF-8 String to your java-Options String depends on how your local settings are setup on the workstation. Most systems are not setup for UTF-8 and so you can force it to use the file-endcoding as UTF-8.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 11:23 am 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
It appears that MySQL ConnectorJ drivers Version 3.1.X does not work well in UTF-8. I changed version to 3.2.X passed 2 parameters through Hibernate config.

Code:
        <property name="hibernate.connection.useUnicode">true</property>
        <property name="hibernate.connection.characterEncoding">UTF8</property>


Also, I had to set up an HttpFilter and set the encoding of the response to UTF-8 because somehow, tomcat was not doing it for me. Must be a parameter to be set somewhere in tomcat config. I'll get to this one later on :).

Other things to look for: Make sure your collation is encoded in utf-8.

Thanks for your answers :)

_________________
Vincent Giguère
J2EE Developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 05, 2005 3:18 pm 
Regular
Regular

Joined: Tue Dec 09, 2003 2:39 pm
Posts: 106
Location: Toronto, Canada
Anyway to specify character set on individual columns? I want to specify character set latin 1 on ID columns using UUID.HEX.

SchemaUpdate utility fails because it wants to use varchars of size 255. In UTF-8 this is 255 multipled by 3. Not a problem until you use a composite key.

Or is there a way to say use varchar of a smaller size to Hibernate?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.