Page 1 of 1
Invalid Chinese character on version 6.7
Posted: Tue 11 May 2010 08:19
by delphi2005
Hi!
After I upgrade ODAC from version 5.70 to 6.70, my application no longer display and store Chinese character correctly into the database. The database version is 9g and the character set is WE8ISO8859P1. The Chinese character will be encoded in UTF8 before storing into the database. When I was using version 5.70, this problem is not happening. Could you please advise if there is any way to store the Chinese character correctly with version 6.70?
FYI, I’m using Delphi 2005. Thanks!
Posted: Wed 12 May 2010 12:14
by bork
Hello
Unfortunately, the information you have provided is not enough to reproduce your issue. We need additional information:
- charset of your database (the result of executing the query: select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET')
- national charset of your database (the result of executing the query: select value from nls_database_parameters where parameter = 'NLS_NCHAR_CHARACTERSET')
- value of the option “Options.Charset”
- value of the option “Options.Direct”
- value of the option “Options.UseUnicode”
- values of any other options or properties the default values of which were changed
- the exact version of your ODAC components (for example 6.90.0.57)
Posted: Thu 13 May 2010 02:12
by delphi2005
Hi bork,
Thanks for your reply. Here’s the info you requested:-
Character set - WE8ISO8859P1
National character set - AL16UTF16
Current ODAC component version – 6.70.0.45
Previous ODAC component version – 5.70.1.32
The options I use are:-
Options.Charset:= '';
Options.Direct:= True;
Options.UseUnicode:= False;
Options.Net:= True;
Btw, I use varchar2 data type to store the UTF8 encoded Chinese data in Oracle.
Hope the info helps. Thanks again.
Posted: Thu 13 May 2010 13:40
by bork
Hello
Try to set the Options.Charset property to the 'WE8ISO8859P1' value and try to read and write your Chinese data again. If it doesn't help please try to connect in OCI mode (set the Options.Direct property to False). We should know if this problem occurs in the direct connection or not. And please notify us about the results.
Posted: Fri 14 May 2010 06:56
by delphi2005
Hi,
With Options.Charset to 'WE8ISO8859P1', the issue still happens. But, if connect in OCI mode, the issue is resolved. In that case, all the target machines will be required to install OCI in the first place. Is that possible to make it work in Direct mode?
Thank you.
Posted: Fri 14 May 2010 11:54
by bork
Hi
I got Chinese Unicode string, converted it to UTF8, and saved to Oracle 9.2 in the direct mode. Later I read this string and this string was correct. I used ODAC version 6.70.0.45 in the direct mode.
To resolve your issue for the direct mode we should reproduce it at first. Without your help we cannot do it. Please send us a small sample application that will convert Chinese Unicode string to UTF8, store this string to Oracle, and read this string back.
Posted: Sat 15 May 2010 04:17
by delphi2005
Hi,
I have found the root cause of the problem.
As my application needs to work on different database character sets (‘WE8ISO8859P1’ and ‘AL32UTF8’), thus I have to query the database character set and set to the Options.Charset after the connection has established (connect mode). By doing so, the issue will happen. But, if I disconnect the connection then set the Options.Charset and reconnect, the issue is resolved.
Is this the proper way to set the Options.Charset in connect mode?
Please advise.
FYI, I have tested the above in Direct mode.
Posted: Mon 17 May 2010 13:34
by bork
Hello
In the OCI mode you can change CharSet after OraSession is connected. But in the Direct mode you cannot. This is a restriction of the Direct mode and you should reconnect to database to change your CharSet.
Posted: Wed 19 May 2010 01:22
by delphi2005
Noted. Thanks for your help.