Forum OpenACS Q&A: Re: PHP character encoding problem

Collapse
Posted by brad chick on
I am having trouble getting Chinese characters in/out of oracle with AOLserver. Here is my stack:

Oracle 11g
TCL 8.5
AOLserver 4.51
Oracle Driver version 2.7

The existing database has a database character set of WE8ISO8859P1.
But we are using NCHAR and NVARCHAR2 datatypes to store Unicode characters. The
NLS_NCHAR_CHARACTERSET is properly set to AL16UTF16.

I am setting the following in the environment as an nsd wrapper:

export NLS_LANG=_.UTF8

I can login to sqlplus and insert and select chinese characters:

insert into test_zhs (foo) values (N'男孩儿男孩儿');

SQL> select * from test_zhs;

FOO
--------------------------------------------------------------------------------
男孩儿男孩儿

I also am sure that aolserver/tcl are treating the characters appropriately.
For example, this form takes whatever characters are inputed into the form, tries to insert them, and spits them back out.
When chinese characters are inputed, that is how the server returns them.
http://jp.xacte.com:8181/test/db/myform.tcl

On the other hand, no matter what I try, I can't get aolserver to get them into oracle properly. I suspect it's the oracle
driver, but people have suggested that it is possible to put unicode characters into oracle using that driver.

Any help would be way helpful.

Thanks