Page 1 of 1

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

Posted: Fri 26 Oct 2007 09:05
by mgandalf
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.

Posted: Fri 26 Oct 2007 09:47
by Alexey
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.

Posted: Fri 26 Oct 2007 10:40
by mgandalf
Hello Alexey,

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

Posted: Fri 26 Oct 2007 15:40
by Alexey
We are investigating your project.
You will be notified on results as soon as possible.

Posted: Tue 11 Dec 2007 07:32
by mgandalf
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

Posted: Fri 16 Jan 2009 14:19
by Shalex
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