Friday, 15 May 2015

Geting UTF-8 character issue in Oracle and Java -


There is a table in Oracle with column type NVARCHAR2 . In this column I am trying to save the Russian alphabet. But this one ¿¿¿¿¿¿¿¿¿¿ï¿½ looks like this? When I try to get the same letter from java, I'm getting the same string.

I have tried with NCHAR VARCHAR2 . But in all cases there is a single problem.

Is this problem from Java or Oracle? I'm trying the same Java code, using PostgreSQL using the same characters that are working fine. I do not know whether this problem is from Oracle or Java?

In my database, there is NLS_NCHAR_CHARACTERSET property value AL16UTF16 . Any idea how I can show UTF-8 characters because it is in Java that was saved in Oracle.

With problem letters you can not trust your eyes. The database may store correct character values ​​but your visual tool does not understand them. Or maybe the characters may be converted somewhere on the way due to language settings.

Select dump function:

example:

  to find out which character values ​​are stored in your table Dump (mycolumn), mycolumn mytable;   

This will give you the byte value of your data and you can check whether the values ​​in your table are present or not.

No comments:

Post a Comment