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
-
1Are you sure that you have the right database character set?bmargulies– bmargulies2009-11-17 02:36:43 +00:00Commented Nov 17, 2009 at 2:36
-
yeah. when i type directly through pl/sql and save the nihongo data it is successfully saved. but when i use my app with hibernate it saves inverted question markscedric– cedric2009-11-17 03:23:15 +00:00Commented Nov 17, 2009 at 3:23
Add a comment
|
1 Answer
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"))
3 Comments
cedric
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.
Bozho
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.
cedric
Whew.. After a week of troubleshooting. This solved my problem. I created a new instance of db using AL32UTF8 charset. Tnx .. :)