ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <larry.mead...@gmail.com>
Subject Re: Problem with Character Encoding
Date Sat, 13 Mar 2010 01:26:24 GMT
I just happen to have spent the last month wrestling with Oracle and
UTF-8 encoding. I had to deal with BLOBs, but Strings should be
easier.

Oracle stores VARCHAR2, VARCHAR, and CLOB fields as unicode and when
the driver fetches the value, it goes into a String which is just an
array of unicode characters, so that should be OK. Regardless of the
database encoding, you should be getting unicode Strings back.

Have you verified that the encoding of the jsp (and browser) are set to utf-8?

Do you have a unit test that shows the problem?

It might be worth examining the characters in the values that are
boogered up to verify that they are coming through correctly. Look at
the String in a debugger and you should be able to see the array of
characters that make it up.

For example, the "é" character should be "\u00E9". If you convert it
to bytes (yourString.getBytes("UTF-8")), you should see 2 byte values
for that character: 0xC3 and 0xA9 - since those are bytes, they may
show up in your debugger as negative values: -61 and -87.

http://www.fileformat.info/info/unicode/char/00e9/index.htm

Let us know what you find out. :)

Larry

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message