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;
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;
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.