URGENT: JDEV1013 + UTF-8 encoding problem
582426Jun 14 2007 — edited Jun 22 2007Hi all,
I'm having trouble saving UTF-8 characters through an ADF form to my database.
When 3-byte long UTF-8 character is saved, dump(xxxx,16) shows that each of the 3 bytes have been converted to 2-byte long UTF-8 characters.
I have the following lines in my .jspx file that contains the form:
<?xml version='1.0' encoding='UTF-8'?>
...
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/> (I tried not having pageEncoding attr, that didn't work either)
...
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8"/>
Some of my db setting:
NLS_CHARACTERSET=AL32UTF8
NLS_LANGUAGE=AMERICAN
NLS_TERRITORY=AMERICA
I also have:
project properties>compiler>character encoding option = 'UTF-8'
and tools>preferences>environment>encoding option = 'UTF-8'
None of the above fixed my problem, so I tried adding the following to filter defintions in the web.xml:
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
This also didn't fix the problem.
It seems like it's treating my UTF-8 characters as 'WE8ISO8859P1', and thus the character goes through double encoding.(I have no clue where this occurs.)
I actually discovered that the value that ends up in the db is same as:
convert(X, 'AL32UTF8','WE8ISO8859P1') where X=my UTF-8 character
When I insert X into db using an insert statement using SQLDeveloper, 3-byte long UTF-8 character is stored correctly and gets displayed in the UI properly.
Any advice will be greatly appreciated.
Thanks,
John