views:

524

answers:

2

Hi,

So I have a database with a table, where one of it's entries is 'é€áí', and I know this is correct in the db. It is stored as a clob.

In Java, I retrieve the entry like so:

String text = resultSet.getString(DBConstants.COL_NOTE_TEXT);

When debugging, text is equal to 'é\u0080áí' and when displayed on the screen the euro symbol is a square block.

Anyone seen this before? Any suggestions?

Thanks in advance.

+1  A: 

0080 is the euro character in the Windows Western encoding (cp-1252); in Unicode it is 20AC. You may want to check the encoding of the input. The other thing to check is that the screen is capable of displaying the euro symbol. If it will display '\u20AC' that part is answered.

Kathy Van Stone
Beat me to it, I was just writing that up. :-P
Andrzej Doyle
The problem could be that the DB is storing cp1252 data (in which case you change the Java type to BLOB), or it could be something related to the transfer of data (which has to be encoded into bytes).
Kathy Van Stone
+1  A: 

See:

oracle-jdbc-euro-character

Think this is my problem. Thanks for the help though.

Ed