Cannot read unicode characters from nvarchar columns (Japanese; Euro-Symbol)

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
mgandalf
Posts: 3
Joined: Thu 25 Oct 2007 10:20

Cannot read unicode characters from nvarchar columns (Japanese; Euro-Symbol)

Post by mgandalf » Fri 26 Oct 2007 09:05

I’ve got to read unicode characters from an Oracle nvarchar column via direct mode, especially Japanese characters and the Euro-Symbol (€).
While I’m able to write them correctly, I am not able to read them.

I’m writing the data using the Oracle unistr function and I can verifiy the correct data in Oracle Enterprise Manager.

It works fine with all printable characters within the range U+0000 through U+00FF, of course, but when I’m reading characters beyond that range, each character beyond is mapped to a character starting with U+00.. mostly to U+00BF(¿).

That’s the way I select the data from the database:

Code: Select all

string SQL = "select * from {0}";
SQL = String.Format(SQL, TABLE_NAME);

CoreLab.Oracle.OracleDataAdapter DataAdapter = new CoreLab.Oracle.OracleDataAdapter(SQL, mDB);
DataAdapter.SelectCommand.CommandTimeout = 0;
DataSet DataSet = new DataSet();
DataAdapter.Fill(DataSet);
DataTable Result = DataSet.Tables[0];

string Text = Result.Rows[0][0].ToString();
this.textBox2.Text = Text;
where mDB is an object of CoreLab.Oracle.OracleConnection with
ConnectionString = "User Id=user;Password=password;Server=DBServer;Port=1521;SID=TestDB;Pooling=true;Direct=true;Unicode=true";

e.g. String “Euro: € - Japan: 説法認ま” is returned as “Euro: ¿ - Japan: ¿¿¿¿” :-(

In contrast to the behaviour of the CoreLab data provider, I can read the data correctly if I use the data provider from Oracle Corp. in a way nearly the same as above:

Code: Select all

string string SQL = "select * from {0}";
SQL = String.Format(SQL, TABLE_NAME);

Oracle.DataAccess.Client.OracleDataAdapter OraAdapter = new Oracle.DataAccess.Client.OracleDataAdapter(SQL, mOraDB);
OraAdapter.SelectCommand.CommandTimeout = 0;
DataSet DataSet = new DataSet();
OraAdapter.Fill(DataSet);
DataTable Result = DataSet.Tables[0];

string Text = Result.Rows[0][0].ToString();
this.textBox2.Text = Text;
e.g. String “Euro: € - Japan: 説法認ま” is correcly returned as “Euro: € - Japan: 説法認ま”


I’m using an Oracle 9i database server (9.2.0.6; NLS_CHARACTERSET = WE8ISO8859P1, NLS_NCHAR_CHARACTERSET = AL16UTF16), Client is a C# (Visual Studio 2005) application on a German Windows XP.

Any help or hint that helps me solving this problem would be highly appreciated.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 26 Oct 2007 09:47

Please send me a small test project to reproduce the problem.
Include the definition of your own database objects.
Use e-mail address provided in the Readme file.
Do not use third party components.

mgandalf
Posts: 3
Joined: Thu 25 Oct 2007 10:20

Post by mgandalf » Fri 26 Oct 2007 10:40

Hello Alexey,

thanks for your quick response!
I've sent a ZIP file containing the requested files to [email protected]

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 26 Oct 2007 15:40

We are investigating your project.
You will be notified on results as soon as possible.

mgandalf
Posts: 3
Joined: Thu 25 Oct 2007 10:20

Post by mgandalf » Tue 11 Dec 2007 07:32

Alexey wrote:We are investigating your project.
You will be notified on results as soon as possible.
Hello Alexey,

Have you already been able to reproduce this behaviour?
My boss wants to have a proposal by the end of this year which DB provider we shall use in the future.
For installation reasons your provider would be the best, because no installation of Oracle client is required.
But for the use of our software in Japan it is absolutely necessary that the provider supports Japanese characters completely.
I'd like to finish my test phase within the next two weeks, so I'd appreciate if you could give me an answer (maybe I just have to use some different settings in my connection string).

Best regards

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

Post by Shalex » Fri 16 Jan 2009 14:19

The bug with reading NVARCHAR fields in Direct mode is fixed in the 5.00.20 build of dotConnect for Oracle which is available for download now.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users Area (for users with valid subscription only).

For more information, please visit: http://www.devart.com/forums/viewtopic.php?t=13898

Post Reply