-->
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.  [ 3 posts ] 
Author Message
 Post subject: hibernate reads utf-8 as iso8859-1. Why?
PostPosted: Wed Nov 25, 2009 10:24 am 
Newbie

Joined: Wed Nov 25, 2009 9:58 am
Posts: 3
Hello forum,

i've got an UTF8-enabled MySQL-db v5.0.70.
Additionally, i enabled the tables as UTF-8:
Code:
mysql> show create table person
CREATE TABLE `person` (
  `id` bigint(20) NOT NULL auto_increment,
  `isCustomer` tinyint(1) NOT NULL default '1',
  `name` varchar(60) NOT NULL,
  `givenName` varchar(60) NOT NULL,
  `sex` enum('MALE','FEMALE') NOT NULL,
  `title` varchar(60) default NULL,
  `street` varchar(60) NOT NULL,
  `streetNr` varchar(10) NOT NULL,
  `plz` mediumint(9) NOT NULL,
  `city` varchar(60) NOT NULL,
  `streetNrAddon` varchar(20) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1427 DEFAULT CHARSET=utf8

Then i generated POJO's via hibernate v3.2, using following url:

jdbc:mysql://db.smartnet.de/smartprov?useUnicode=true&characterEncoding=utf-8

JDBC is v5.1.6.

If i access the results via personDAO, the results are ISO8859-1. I don't know why?

Any help would be appreciated,
kind regards, Florian


Top
 Profile  
 
 Post subject: Re: hibernate reads utf-8 as iso8859-1. Why?
PostPosted: Wed Nov 25, 2009 10:35 pm 
Newbie

Joined: Wed Nov 25, 2009 6:47 pm
Posts: 1
I believe if you do a raw Connection/ResultSet, you will be able to prove to yourself Hibernate is not the issue


Top
 Profile  
 
 Post subject: Re: hibernate reads utf-8 as iso8859-1. Why?
PostPosted: Thu Nov 26, 2009 4:02 am 
Newbie

Joined: Wed Nov 25, 2009 9:58 am
Posts: 3
I don't think so:

If i read out mysql via shell or via MySQL-Query-Browser, all is well formed unicode..


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