Re: [AOLSERVER] chinese characters and oracle driver

21 views
Skip to first unread message

Brad Chick

unread,
Jul 18, 2011, 11:19:26 AM7/18/11
to AOLS...@listserv.aol.com
I don't think it's tcl at this point. I can see that aolserver/tcl can bring
in the unicode characters and return them to the client 'as is'.

And you can see what encoding system tcl is using via this command as well:

[encoding system]

which shows that tcl is using UTF-8, which is what is desired.

As well, I have another stack that has the same architecture, with the
exception of the db/driver:

aolserver 4.51/tcl 8.5/mysql/nsmsql

and that works right out of the box. I can pass in any unicode characters
(e.g. Braille, Farsi, Gaelic, etc.) and everything works. The strings are
put in mysql and pulled out perfectly.

In the oracle case, it's simple to see that it's not the db: with sqlplus, I
can insert/select into/from oracle and everything looks fine.

So, it seems like all that is left is the oracle driver.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <list...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Fenton, Brian

unread,
Jul 18, 2011, 11:37:19 AM7/18/11
to AOLS...@listserv.aol.com
It might be that the Oracle driver doesn't handle those column types. Is there anything in the AOLserver log? Maybe turn on debug to get more info.

Brian

________________________________________
From: AOLserver Discussion [AOLS...@LISTSERV.AOL.COM] On Behalf Of Brad Chick [br...@CHICKCENTRAL.COM]
Sent: 18 July 2011 16:19
To: AOLS...@LISTSERV.AOL.COM
Subject: Re: [AOLSERVER] chinese characters and oracle driver

Brad Chick

unread,
Jul 18, 2011, 12:48:22 PM7/18/11
to AOLS...@listserv.aol.com
I just grabbed the latest oracle driver from cvs and you are right: there is
no explicit support for either NCHAR or NVARCHAR2 - which oracle requires to
store unicode characters.

So, I will try to update the driver and report back.

Thanks

Brad Chick

unread,
Jul 18, 2011, 3:03:46 PM7/18/11
to AOLS...@listserv.aol.com
Well, I reached an impasse. I grabbed the latest source from CVS, added
support for the 2 datatypes (NCHAR, NVARCHAR2), and recompiled. Then, I
turned on debugging for the driver.

The logs look great. The driver constructs the queries appropriately:

e.g. [18/Jul/2011:14:17:30][10744.1099659584][-default:1-] Notice:
nsoracle.c:3169:Ns_OracleExec: entry (dbh 0xd8392b0, sql insert into
test_zhs (foo, bar) values (N'男孩儿 儿男孩 Yo', N'男孩儿 儿男孩 Yo'))

But the data somehow gets mangled in oracle. And that same insert statement
works perfectly well in sqlplus:

insert into test_zhs (foo, bar) values (N'男孩儿 儿男孩 Yo', N'男孩儿 儿男孩
Yo');
(and i've tried it a million ways (e.g. without the leading 'N'')).

When viewed from sqplus, the sqplus added data looks fine, while the stuff
that comes in through the driver is mangled.

Dunno.

Janine Ohmer

unread,
Jul 18, 2011, 3:16:51 PM7/18/11
to AOLS...@listserv.aol.com
Make sure that any vars set in your shell environment that relate to this are also set in your nsd wrapper script. I wish I knew for sure if that is enough for them to be effective, but I don't. I vaguely recall that the C API the driver uses is called Pro-C on the Oracle side - you might want to see if you can find some docs on that for your Oracle version and see if they can shed any light on this. Maybe you have to do something in the driver to make sure your language settings are acted upon.

janine

---
Janine Ohmer (formerly Sisk)
President/CEO of furfly, LLC
503-693-6407

Fenton, Brian

unread,
Jul 19, 2011, 4:12:01 AM7/19/11
to AOLS...@listserv.aol.com
Also, try first solving the problem of reading from the database. So if you have some data in a table that you know is correctly stored, try a sql query from AOLserver, and see if you can pinpoint where it gets converted.
Once you have that sorted, writing to the database should be solvable.

Brian

Fenton, Brian

unread,
Jul 19, 2011, 6:58:25 AM7/19/11
to AOLS...@listserv.aol.com
Also take a look at the CharExpansion parameter. I had some issues with that a few years ago (and the documentation seems to be back to front just to make it even more confusing!). :-)

http://www.mail-archive.com/aols...@listserv.aol.com/msg09664.html

________________________________________
From: Fenton, Brian
Sent: 19 July 2011 09:12
To: AOLserver Discussion
Subject: Re: [AOLSERVER] chinese characters and oracle driver

Reply all
Reply to author
Forward
0 new messages