Hi, we have some encoding issue .
server; Oracle 8i Windows(CHARSET:JA16SJIS)
clinet: Windows 10/dotConnect oracle 9.7.805(evaluting/Direct mode)/C#
There are some CHAR(n) columns contains Multi-byte(Shift-JIS) characters.
Almost characters can converted valid Unicode, but 'platform dependent' characters
like '\x878a' shown as 'u+fffd'(shuld 'u+3231').
Also, query contains platform dependent characters doesn't work right.
How to solve this problem?
encoding issue
Re: encoding issue
Confirm that the issue persists with the "Unicode=true;" connection string parameter as well.
1. Execute "SELECT * FROM NLS_DATABASE_PARAMETERS" against Oracle 8i and specify your values:
a) NLS_CHARACTERSET
b) NLS_NCHAR_CHARACTERSET
c) NLS_LANGUAGE
d) NLS_RDBMS_VERSION
2. Navigate to Control Panel > Region and tell us regional settings of your Windows 10 where you are using dotConnect for Oracle:
a) the Format drop-down value
b) Location
c) Language for non-Unicode programs
3. Are you using .NET Framework Devart.* assemblies (shipped with provider installation) or .NET Standard Devart.* assemblies (available via https://www.nuget.org/packages/devart.data.oracle)?
4. Describe your test application:
a) are you reading character via OracleDataReader.GetChar() or some other way?
b) did you change a default encoding of your application? Refer to https://docs.microsoft.com/en-us/dotnet ... mework-4.8
c) can you read the character 'u+3231' via our provider if you convert it to AL32UTF8 on Oracle side via "select CONVERT(fieldname, 'AL32UTF8', 'JA16SJIS') from tabllename;"?
5. A small test project with the corresponding DDL/DML script for reproducing will be appreciated. Upload it to some file exchange server (e.g.: www.dropbox.com) and send us the download link.
1. Execute "SELECT * FROM NLS_DATABASE_PARAMETERS" against Oracle 8i and specify your values:
a) NLS_CHARACTERSET
b) NLS_NCHAR_CHARACTERSET
c) NLS_LANGUAGE
d) NLS_RDBMS_VERSION
2. Navigate to Control Panel > Region and tell us regional settings of your Windows 10 where you are using dotConnect for Oracle:
a) the Format drop-down value
b) Location
c) Language for non-Unicode programs
3. Are you using .NET Framework Devart.* assemblies (shipped with provider installation) or .NET Standard Devart.* assemblies (available via https://www.nuget.org/packages/devart.data.oracle)?
4. Describe your test application:
a) are you reading character via OracleDataReader.GetChar() or some other way?
b) did you change a default encoding of your application? Refer to https://docs.microsoft.com/en-us/dotnet ... mework-4.8
c) can you read the character 'u+3231' via our provider if you convert it to AL32UTF8 on Oracle side via "select CONVERT(fieldname, 'AL32UTF8', 'JA16SJIS') from tabllename;"?
5. A small test project with the corresponding DDL/DML script for reproducing will be appreciated. Upload it to some file exchange server (e.g.: www.dropbox.com) and send us the download link.
Re: encoding issue
1)
SQL> SELECT * from NLS_DATABASE_PARAMETERS ;
PARAMETER VALUE
------------------------------ --------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-YY
NLS_DATE_LANGUAGE AMERICAN
NLS_CHARACTERSET JA16SJIS
NLS_SORT BINARY
NLS_NCHAR_CHARACTERSET JA16SJIS
NLS_RDBMS_VERSION 8.0.4.0.0
2)
a)Match Windows display language
b)Japan
c)Japanese
Written in Japanese.
3)
I've executed downloaded installer from devart.com,
and installed 'Devart.Data.Oracle' package from Nuget for project.
4)
a)I tried OracleDataReade.GetChars() and OracleDataReade.GetString().
b)Not registerd. Oh, targetd framework is '.NET Framework 4.6.1'.
c)ORA-01482:unsupportde character set :-/
5)
--------------------- sample code -----------------------
OracleConnectionStringBuilder csb = new OracleConnectionStringBuilder();
csb.Direct = true;
// csb.Server = "***.***.***.***";
csb.Server = "***.***.***.***";
csb.Port = 1521;
csb.Sid = "orcl";
csb.UserId = "***";
csb.Password = "***";
csb.Unicode = true;
OracleConnection conn = new OracleConnection(csb.ConnectionString);
conn.Open();
string sql = "select some_field from some_table";
var command = conn.CreateCommand(sql);
var reader = command.ExecuteReader();
reader.Read();
var value = reader.GetString(0);
---------------------------------------------------------
---------------- also, this works right :-) -------------
string sql = "select DUMP(some_field) from some_table ";
var command = conn.CreateCommand(sql);
var reader = command.ExecuteReader();
reader.Read();
var value = reader.GetString(0);
// parse binary
var n = value.SkipWhile(t => t != ':').Skip(1)
.Aggregate("",(a,c)=>a+=c)
.Split(',').Select( t=>byte.Parse(t)).ToArray();
var str = Encoding.GetEncoding("Shift_JIS").GetString(n);
---------------------------------------------------------
SQL> SELECT * from NLS_DATABASE_PARAMETERS ;
PARAMETER VALUE
------------------------------ --------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-YY
NLS_DATE_LANGUAGE AMERICAN
NLS_CHARACTERSET JA16SJIS
NLS_SORT BINARY
NLS_NCHAR_CHARACTERSET JA16SJIS
NLS_RDBMS_VERSION 8.0.4.0.0
2)
a)Match Windows display language
b)Japan
c)Japanese
Written in Japanese.
3)
I've executed downloaded installer from devart.com,
and installed 'Devart.Data.Oracle' package from Nuget for project.
4)
a)I tried OracleDataReade.GetChars() and OracleDataReade.GetString().
b)Not registerd. Oh, targetd framework is '.NET Framework 4.6.1'.
c)ORA-01482:unsupportde character set :-/
5)
--------------------- sample code -----------------------
OracleConnectionStringBuilder csb = new OracleConnectionStringBuilder();
csb.Direct = true;
// csb.Server = "***.***.***.***";
csb.Server = "***.***.***.***";
csb.Port = 1521;
csb.Sid = "orcl";
csb.UserId = "***";
csb.Password = "***";
csb.Unicode = true;
OracleConnection conn = new OracleConnection(csb.ConnectionString);
conn.Open();
string sql = "select some_field from some_table";
var command = conn.CreateCommand(sql);
var reader = command.ExecuteReader();
reader.Read();
var value = reader.GetString(0);
---------------------------------------------------------
---------------- also, this works right :-) -------------
string sql = "select DUMP(some_field) from some_table ";
var command = conn.CreateCommand(sql);
var reader = command.ExecuteReader();
reader.Read();
var value = reader.GetString(0);
// parse binary
var n = value.SkipWhile(t => t != ':').Skip(1)
.Aggregate("",(a,c)=>a+=c)
.Split(',').Select( t=>byte.Parse(t)).ToArray();
var str = Encoding.GetEncoding("Shift_JIS").GetString(n);
---------------------------------------------------------
Re: encoding issue
Thank you for the test project provided by email. We will investigate it and notify you about the result.