Invalid Chinese character on version 6.7
-
delphi2005
- Posts: 5
- Joined: Tue 11 May 2010 07:51
Invalid Chinese character on version 6.7
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!
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!
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)
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)
-
delphi2005
- Posts: 5
- Joined: Tue 11 May 2010 07:51
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.
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.
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.
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.
-
delphi2005
- Posts: 5
- Joined: Tue 11 May 2010 07:51
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.
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.
-
delphi2005
- Posts: 5
- Joined: Tue 11 May 2010 07:51
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.
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.