Hello,

I've developed a web application (on Windows+Oracle XE) and deployed it into production (Suse+Oracle 10g).
However I have problems inserting unicode characters into database tables in the production environment.

For example I use following jsp code to insert a category name into table:

Java Code:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*,javax.sql.DataSource,javax.naming.*,com.smile.dalc.*" %>
 
<%
        
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8"); 
 
WebPushCategoryDALC.AddWebPushCategory(-1, "Şəkil", 2, 1);  //hardcoded unicode characters for testing
out.print("ok");
 
%>
On Windows it shows ok, but on Suse I have question marks inserted instead of the unicode characters. The column type is nvarchar2.

Below are results of executing the following query both on Windows and Suse:

select * from v$nls_parameters;

Windows:
"Parameter" "Value"
"NLS_CALENDAR" "GREGORIAN"
"NLS_CHARACTERSET" "AL32UTF8"
"NLS_COMP" "BINARY"
"NLS_CURRENCY" "$"
"NLS_DATE_FORMAT" "DD-MON-RR"
"NLS_DATE_LANGUAGE" "AMERICAN"
"NLS_DUAL_CURRENCY" "$"
"NLS_ISO_CURRENCY" "AMERICA"
"NLS_LANGUAGE" "AMERICAN"
"NLS_LENGTH_SEMANTICS" "BYTE"
"NLS_NCHAR_CHARACTERSET" "AL16UTF16"
"NLS_NCHAR_CONV_EXCP" "FALSE"
"NLS_NUMERIC_CHARACTERS" ".,"
"NLS_SORT" "BINARY"
"NLS_TERRITORY" "AMERICA"
"NLS_TIMESTAMP_FORMAT" "DD-MON-RR HH.MI.SSXFF AM"
"NLS_TIMESTAMP_TZ_FORMAT" "DD-MON-RR HH.MI.SSXFF AM TZR"
"NLS_TIME_FORMAT" "HH.MI.SSXFF AM"
"NLS_TIME_TZ_FORMAT" "HH.MI.SSXFF AM TZR"

Suse:
"Parameter" "Value"
"NLS_CALENDAR" "GREGORIAN"
"NLS_CHARACTERSET" "CL8ISO8859P5"
"NLS_COMP" "BINARY"
"NLS_CURRENCY" "$"
"NLS_DATE_FORMAT" "DD-MON-RR hh24:mi:ss"
"NLS_DATE_LANGUAGE" "AMERICAN"
"NLS_DUAL_CURRENCY" "$"
"NLS_ISO_CURRENCY" "AMERICA"
"NLS_LANGUAGE" "AMERICAN"
"NLS_LENGTH_SEMANTICS" "BYTE"
"NLS_NCHAR_CHARACTERSET" "AL16UTF16"
"NLS_NCHAR_CONV_EXCP" "FALSE"
"NLS_NUMERIC_CHARACTERS" ".,"
"NLS_SORT" "BINARY"
"NLS_TERRITORY" "AMERICA"
"NLS_TIMESTAMP_FORMAT" "DD-MON-RR HH.MI.SSXFF AM"
"NLS_TIMESTAMP_TZ_FORMAT" "DD-MON-RR HH.MI.SSXFF AM TZR"
"NLS_TIME_FORMAT" "HH.MI.SSXFF AM"
"NLS_TIME_TZ_FORMAT" "HH.MI.SSXFF AM TZR"

First I wanted to try to change the nls_characterset on Suse to the one on Windows, but then I saw that nls_nchar_characterset is al16utf16 and I use nvarchar2 for my table.

When connecting to Oracle using Oracle SQL Developer and inserting some records with unicode characters into nvarchar2 columns they are displayed correctly in the JSP ui. But unicode characters that are inserted from my application are converted into question marks. The application is hosted by Tomcat 6

Java versions:

Windows:
C:\Users\itrovshan>java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode)

Suse:
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20061002a (SR3) )
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20061001 (JIT enabled)
J9VM - 20060915_08260_lHdSMR
JIT - 20060908_1811_r8
GC - 20060906_AA)
JCL - 20061002


Could you please, help me to find out how I can fix this problem?

Thanks in advance!
Rovshan