<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: UTF-8 with Hibernate 3.0 and MySQL</title>
	<atom:link href="http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=utf-8-with-hibernate-30-and-mysql</link>
	<description>Thoughts and tutorials on web design, Java, Javascript and project management</description>
	<lastBuildDate>Thu, 16 May 2013 13:23:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
	<item>
		<title>By: Eduard</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-3514</link>
		<dc:creator>Eduard</dc:creator>
		<pubDate>Sun, 30 Sep 2012 18:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-3514</guid>
		<description><![CDATA[Also, make sure the MySQL database is UTF-8 aware. For instance, you can create a UTF-8-aware MySQL database like this:
~~~create-database.sql~~~

create database hibernatetest
  DEFAULT CHARACTER SET utf8
  DEFAULT COLLATE utf8_general_ci;

~~~create-database.sql~~~]]></description>
		<content:encoded><![CDATA[<p>Also, make sure the MySQL database is UTF-8 aware. For instance, you can create a UTF-8-aware MySQL database like this:<br />
~~~create-database.sql~~~</p>
<p>create database hibernatetest<br />
  DEFAULT CHARACTER SET utf8<br />
  DEFAULT COLLATE utf8_general_ci;</p>
<p>~~~create-database.sql~~~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andird</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-2928</link>
		<dc:creator>andird</dc:creator>
		<pubDate>Thu, 19 Jan 2012 11:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-2928</guid>
		<description><![CDATA[you just need to encode the ampersand with &amp; on the persistence xml.

...?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8]]></description>
		<content:encoded><![CDATA[<p>you just need to encode the ampersand with &amp;amp; on the persistence xml.</p>
<p>&#8230;?autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=UTF-8</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Yinger</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-1635</link>
		<dc:creator>Andrew Yinger</dc:creator>
		<pubDate>Wed, 07 Sep 2011 00:21:57 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-1635</guid>
		<description><![CDATA[after much struggling this is what works for me:

1. yes, you can modify the JDBC URL, but it&#039;s a little clunky and requires just the right string, e.g.:
   jdbc:mysql://localhost/db?useUnicode=true&amp;characterEncoding=utf8 (assuming this is embedded in XML)

2. a litter clearer, but not well documented at all, are these additional connection settings in the hibernate cfg XML:

   utf8
   true

NOTE: both charSet and useUnicode are required for latest version of hibernate and mysql.  it took me quite a while to figure this out.

again, either 1. or 2. will work, but my preference is for #2.

i wonder when the world will finally understand and make encoding easier.....

frustrated, but struggled and *finally* got it right.]]></description>
		<content:encoded><![CDATA[<p>after much struggling this is what works for me:</p>
<p>1. yes, you can modify the JDBC URL, but it&#8217;s a little clunky and requires just the right string, e.g.:<br />
   jdbc:mysql://localhost/db?useUnicode=true&amp;characterEncoding=utf8 (assuming this is embedded in XML)</p>
<p>2. a litter clearer, but not well documented at all, are these additional connection settings in the hibernate cfg XML:</p>
<p>   utf8<br />
   true</p>
<p>NOTE: both charSet and useUnicode are required for latest version of hibernate and mysql.  it took me quite a while to figure this out.</p>
<p>again, either 1. or 2. will work, but my preference is for #2.</p>
<p>i wonder when the world will finally understand and make encoding easier&#8230;..</p>
<p>frustrated, but struggled and *finally* got it right.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ehsan</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-1627</link>
		<dc:creator>Ehsan</dc:creator>
		<pubDate>Tue, 30 Aug 2011 14:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-1627</guid>
		<description><![CDATA[Thanks Kris your comment was very useful to me.]]></description>
		<content:encoded><![CDATA[<p>Thanks Kris your comment was very useful to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohammad Ilyas Soomro</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-1416</link>
		<dc:creator>Mohammad Ilyas Soomro</dc:creator>
		<pubDate>Mon, 18 Apr 2011 17:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-1416</guid>
		<description><![CDATA[In Hibernate 3.0 with MySQL 4 and mysql-connector 3.0.8, UTF-8 is not working...
core mysql APIs are fetching and inserting utf8 characters correctly, but Hibernate session is not selecting or inserting special characters. I have tried it with &lt;b&gt;Hibernate 3.0 + Mysql 5 + mysql-connector 5.0.8&lt;/b&gt;, working fine... but not with above config

Please help me, how can I insert special characters (UTF-8) using this config :  Hibernate 3.0 + Mysql 4.0.1 + mysql-connector 3.0.8

my hibernat-cfg.xml file contain:

       true 	
	UTF-8 

In JSPs :
 

in HTML :
  

Even I am using :
  request.setCharacterEncoding(&quot;UTF-8&quot;);
 in Filter.

I will highly appreciate...]]></description>
		<content:encoded><![CDATA[<p>In Hibernate 3.0 with MySQL 4 and mysql-connector 3.0.8, UTF-8 is not working&#8230;<br />
core mysql APIs are fetching and inserting utf8 characters correctly, but Hibernate session is not selecting or inserting special characters. I have tried it with <b>Hibernate 3.0 + Mysql 5 + mysql-connector 5.0.8</b>, working fine&#8230; but not with above config</p>
<p>Please help me, how can I insert special characters (UTF-8) using this config :  Hibernate 3.0 + Mysql 4.0.1 + mysql-connector 3.0.8</p>
<p>my hibernat-cfg.xml file contain:</p>
<p>       true<br />
	UTF-8 </p>
<p>In JSPs :</p>
<p>in HTML :</p>
<p>Even I am using :<br />
  request.setCharacterEncoding(&#8220;UTF-8&#8243;);<br />
 in Filter.</p>
<p>I will highly appreciate&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-1221</link>
		<dc:creator>Kris</dc:creator>
		<pubDate>Sat, 18 Sep 2010 14:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-1221</guid>
		<description><![CDATA[Took me a little while to work out that you need to escape the &#039;&amp;&#039;  with &amp; in the hibernate.cfg.xml 

useUnicode=true&amp;characterEncoding=UTF-8]]></description>
		<content:encoded><![CDATA[<p>Took me a little while to work out that you need to escape the &#8216;&amp;&#8217;  with &amp;amp; in the hibernate.cfg.xml </p>
<p>useUnicode=true&amp;amp;characterEncoding=UTF-8</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: moien</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-1170</link>
		<dc:creator>moien</dc:creator>
		<pubDate>Fri, 09 Jul 2010 08:34:06 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-1170</guid>
		<description><![CDATA[SOLVED!
i just had to drop the db and create it again with new unicode collation]]></description>
		<content:encoded><![CDATA[<p>SOLVED!<br />
i just had to drop the db and create it again with new unicode collation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: moien</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-1169</link>
		<dc:creator>moien</dc:creator>
		<pubDate>Fri, 09 Jul 2010 06:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-1169</guid>
		<description><![CDATA[thanx for thiss usefull note.
but i still have a problem inserting persian characters

Hibernate: insert into Stocks (symbol, corpName, maxPrice, minPrice, lastPrice, finishedPrice, yesterdayPrice, changed, percent, bestRequest, bestOffer) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
765 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1366, SQLState: HY000
765 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect string value: &#039;\xD8\xB4\xD8\xA7\xD8\xB1...&#039; for column &#039;symbol&#039;]]></description>
		<content:encoded><![CDATA[<p>thanx for thiss usefull note.<br />
but i still have a problem inserting persian characters</p>
<p>Hibernate: insert into Stocks (symbol, corpName, maxPrice, minPrice, lastPrice, finishedPrice, yesterdayPrice, changed, percent, bestRequest, bestOffer) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)<br />
765 [main] WARN org.hibernate.util.JDBCExceptionReporter &#8211; SQL Error: 1366, SQLState: HY000<br />
765 [main] ERROR org.hibernate.util.JDBCExceptionReporter &#8211; Incorrect string value: &#8216;\xD8\xB4\xD8\xA7\xD8\xB1&#8230;&#8217; for column &#8216;symbol&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shawary</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-1111</link>
		<dc:creator>shawary</dc:creator>
		<pubDate>Mon, 03 May 2010 06:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-1111</guid>
		<description><![CDATA[thanks a lot for your post .... i steel has this problem . i am using hibernate3 with spring and  jdbc:mysql://localhost/mydb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8 dose not work 4 me please advice.]]></description>
		<content:encoded><![CDATA[<p>thanks a lot for your post &#8230;. i steel has this problem . i am using hibernate3 with spring and  jdbc:mysql://localhost/mydb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8 dose not work 4 me please advice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UTF-8 mit Hibernate und MySQL &#171; shaack´s Technik-Weblog</title>
		<link>http://isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/comment-page-1/#comment-942</link>
		<dc:creator>UTF-8 mit Hibernate und MySQL &#171; shaack´s Technik-Weblog</dc:creator>
		<pubDate>Mon, 23 Nov 2009 13:50:16 +0000</pubDate>
		<guid isPermaLink="false">http://deniss-mac.lan/isocra/newsite/blogs/?p=14#comment-942</guid>
		<description><![CDATA[[...] Gefunden auf: http://www.isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Gefunden auf: <a href="http://www.isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/" rel="nofollow">http://www.isocra.com/2007/01/utf-8-with-hibernate-30-and-mysql/</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
