views:

137

answers:

1
+2  Q: 

Hibernate Encoding

Hi. Im trying to insert data with japanese characters to an oracle database. The things is what is saved in the database are bunch of inverted question marks. HOw do I resolve this

+2  A: 

See http://www.errcode.net/blogs/?p=6 to determine the encoding of your database. I'm currently using Oracle with Hibernate in UTF-8 with no extra configurations.

Aslo, you might want to check whether the input values come correctly encoded. For example, if you have a web application, check the request parameter encoding (or set it, with request.setCharacterEncoding("utf-8"))

Bozho
I am using oracle database to with hibernate. Current encoding of my database is WE8MSWIN1252. anyway i can save nihongo characters successfully though through PL/SQL. The values I inserted too do not come from page forms.. I initially hard coded the values in my DAO to check if the problem is with the request encoding or with the hibernate itself.
cedric
Well, there goes your problem - change the encoding to UTF-8 (not 1252). The fact that it worked from some place, doesn't mean the settings are correct. And hard-coded values are affected by the java file encoding, or VM encoding - too many variables to check.
Bozho
Whew.. After a week of troubleshooting. This solved my problem. I created a new instance of db using AL32UTF8 charset. Tnx .. :)
cedric