Chinese garbled?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
cmm
Posts: 2
Joined: Mon 23 Dec 2019 05:10

Chinese garbled?

Post by cmm » Mon 23 Dec 2019 05:24

i am using the newest devart.data.oracle (9.9.887).
the oracle db is 11g,i have made a test below:(i removed the license key)
OracleConnectionStringBuilder csb = new OracleConnectionStringBuilder();
csb.Direct = true;
csb.Server = "153.153.153.xxx";
csb.Port = 1521;
csb.Sid = "docare";
csb.UserId = "clinic";
csb.Password = "clinic";
csb.Unicode = true;
csb.LicenseKey = "...";
OracleConnection conn = new OracleConnection(csb.ConnectionString);

conn.Open();


string sql = "select t.NAME from view_cpc_patient_info t where rownum<=1";
var command = conn.CreateCommand(sql);
var reader = command.ExecuteReader();
reader.Read();
var value = reader.GetString(0);
return value;

when the result is simple-chinese, will be "??????"?
How to deal with it?i am very worried about this problem

Shalex
Site Admin
Posts: 9029
Joined: Thu 14 Aug 2008 12:44

Re: Chinese garbled?

Post by Shalex » Thu 26 Dec 2019 20:01

1. Make sure that Chinese data are stored correctly (not "??????") in your view_cpc_patient_info table. Try to read them via SQL Plus or SQL Developer.

2. The issue could be caused by the encoding of your operating system where you are running the code. In Windows, check Control Panel > Region > Administrative > Language for non-Unicode programs. Try setting system locale to the one that works with Chinese symbols.

3. If Oracle Client is installed on your workstation, retrieve the data with "Direct=false;" in the connection string. Does the issue persist?

4. Specify:
a) system locale of your operating system
b) the data type of your view_cpc_patient_info.NAME column
c) Chinese characters used for the test
d) the values of the following parameters on your Oracle Server (run "select * from nls_database_parameters")
NLS_RDBMS_VERSION
NLS_CHARACTERSET
NLS_NCHAR_CHARACTERSET
NLS_LANGUAGE
NLS_TERRITORY

cmm
Posts: 2
Joined: Mon 23 Dec 2019 05:10

Re: Chinese garbled?

Post by cmm » Fri 27 Dec 2019 03:13

tks,this issues i have modify,
the oralce server and client language is US7ASCII,
1.Not garbled in plsql,
2.Made a test framework version with devart.data.oracle 8.5 version ,that is Show Chinese normal.
3.OLEDB is normal.
4.use the newest devart.data.oracle is not normal.

Shalex
Site Admin
Posts: 9029
Joined: Thu 14 Aug 2008 12:44

Re: Chinese garbled?

Post by Shalex » Mon 30 Dec 2019 12:05

Shalex wrote:
Thu 26 Dec 2019 20:01
2. The issue could be caused by the encoding of your operating system where you are running the code. In Windows, check Control Panel > Region > Administrative > Language for non-Unicode programs. Try setting system locale to the one that works with Chinese symbols.

3. If Oracle Client is installed on your workstation, retrieve the data with "Direct=false;" in the connection string. Does the issue persist?

4. Specify:
a) system locale of your operating system
b) the data type of your view_cpc_patient_info.NAME column
c) Chinese characters used for the test
d) the values of the following parameters on your Oracle Server (run "select * from nls_database_parameters")
NLS_RDBMS_VERSION
NLS_CHARACTERSET
NLS_NCHAR_CHARACTERSET
NLS_LANGUAGE
NLS_TERRITORY
Please answer these questions.

Post Reply