Encoding problem with Oracle 12c after update to 2.2 EF core

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
SergeyPechenik
Posts: 7
Joined: Tue 05 Mar 2019 18:59

Encoding problem with Oracle 12c after update to 2.2 EF core

Post by SergeyPechenik » Tue 05 Mar 2019 19:50

We updated from EF Core 2.1 with Devart.Data.Oracle.EFCore 9.6.621
to EF Core 2.2 with Devart.Data.Oracle.EFCore 9.6.696

But we get strange strings now. It's looks like that:
"\0L\0o\0r\0e\0m\0 \0i\0p\0s\0u\0m\0 \0d\0o\0l\0o\0r\0 \0s\0i\0t\0 \0a\0m\0e\0t\0"
and like that:
"\u0004#\0 \u0004?\u0004>\u0004?\u00040\0 \u00041\u0004K\u0004;\u00040\0 \u0004A\u0004>\u00041\u00040\u0004:\u00040\0 \u0004>\u0004=\0 \u00045\u0004Q\0"

Previous version was worked fine. 'Unicode=true' and 'Unicode=false' connection string parameter, does not make any effect.

Oracle server: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Collation:
NLS_SORT BINARY
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CHARACTERSET AL32UTF8

How to solve this problem?

P.S. Columns type NVARCHAR2

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

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by Shalex » Mon 11 Mar 2019 18:34

We cannot reproduce the issue in our environment.

Please specify:

1) your connection string (mark confidential information with asterisks)

2) does the issue persist with reading the existing records or with inserting the new records?

3) give us an example of the original string that got corrupted after the upgrade

SergeyPechenik
Posts: 7
Joined: Tue 05 Mar 2019 18:59

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by SergeyPechenik » Thu 28 Mar 2019 10:40

Sorry, for long response.

1) Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT=***)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=***)));User Id=***;Password=***;Direct=true;license key=***

2) the issue persist with reading the existing records and with inserting the new records;

when inserting string with dotConnect: Encoding problem with Oracle 12c after update to 2.2 EF core
in dbForge i see: 䕮捯摩湧⁰牯扬敭⁷楴栠佲慣汥‱㉣⁡晴敲⁵灤慴攠瑯′⸲⁅䘠捯牥
But i can read this string in dot connect fine!

if i insert string in dbforge, cant read it in dotConnect.

3) Original string: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

readed string: "\0L\0o\0r\0e\0m\0 \0i\0p\0s\0u\0m\0 \0d\0o\0l\0o\0r\0 \0s\0i\0t\0 \0a\0m\0e\0t\0,\0 \0c\0o\0n\0s\0e\0c\0t\0e\0t\0u\0r\0 \0a\0d\0i\0p\0i\0s\0c\0i\0n\0g\0 \0e\0l\0i\0t\0,\0 \0s\0e\0d\0 \0d\0o\0 \0e\0i\0u\0s\0m\0o\0d\0 \0t\0e\0m\0p\0o\0r\0 \0i\0n\0c\0i\0d\0i\0d\0u\0n\0t\0 \0u\0t\0 \0l\0a\0b\0o\0r\0e\0 \0e\0t\0 \0d\0o\0l\0o\0r\0e\0 \0m\0a\0g\0n\0a\0 \0a\0l\0i\0q\0u\0a\0.\0 \0U\0t\0 \0e\0n\0i\0m\0 \0a\0d\0 \0m\0i\0n\0i\0m\0 \0v\0e\0n\0i\0a\0m\0,\0 \0q\0u\0i\0s\0 \0n\0o\0s\0t\0r\0u\0d\0 \0e\0x\0e\0r\0c\0i\0t\0a\0t\0i\0o\0n\0 \0u\0l\0l\0a\0m\0c\0o\0 \0l\0a\0b\0o\0r\0i\0s\0 \0n\0i\0s\0i\0 \0u\0t\0 \0a\0l\0i\0q\0u\0i\0p\0 \0e\0x\0 \0e\0a\0 \0c\0o\0m\0m\0o\0d\0o\0 \0c\0o\0n\0s\0e\0q\0u\0a\0t\0.\0 \0D\0u\0i\0s\0 \0a\0u\0t\0e\0 \0i\0r\0u\0r\0e\0 \0d\0o\0l\0o\0r\0 \0i\0n\0 \0r\0e\0p\0r\0e\0h\0e\0n\0d\0e\0r\0i\0t\0 \0i\0n\0 \0v\0o\0l\0u\0p\0t\0a\0t\0e\0 \0v\0e\0l\0i\0t\0 \0e\0s\0s\0e\0 \0c\0i\0l\0l\0u\0m\0 \0d\0o\0l\0o\0r\0e\0 \0e\0u\0 \0f\0u\0g\0i\0a\0t\0 \0n\0u\0l\0l\0a\0 \0p\0a\0r\0i\0a\0t\0u\0r\0.\0 \0E\0x\0c\0e\0p\0t\0e\0u\0r\0 \0s\0i\0n\0t\0 \0o\0c\0c\0a\0e\0c\0a\0t\0 \0c\0u\0p\0i\0d\0a\0t\0a\0t\0 \0n\0o\0n\0 \0p\0r\0o\0i\0d\0e\0n\0t\0,\0 \0s\0u\0n\0t\0 \0i\0n\0 \0c\0u\0l\0p\0a\0 \0q\0u\0i\0 \0o\0f\0f\0i\0c\0i\0a\0 \0d\0e\0s\0e\0r\0u\0n\0t\0 \0m\0o\0l\0l\0i\0t\0 \0a\0n\0i\0m\0 \0i\0d\0 \0e\0s\0t\0 \0l\0a\0b\0o\0r\0u\0m\0."

Another one:
Was: У попа была собака он её любил, она съела кусок мяса он её убил, закопал её в могилу на могиле написал, у попа была собака он её любил...
Became: "\u0004#\0 \u0004?\u0004>\u0004?\u00040\0 \u00041\u0004K\u0004;\u00040\0 \u0004A\u0004>\u00041\u00040\u0004:\u00040\0 \u0004>\u0004=\0 \u00045\u0004Q\0 \u0004;\u0004N\u00041\u00048\u0004;\0,\0 \u0004>\u0004=\u00040\0 \u0004A\u0004J\u00045\u0004;\u00040\0 \u0004:\u0004C\u0004A\u0004>\u0004:\0 \u0004<\u0004O\u0004A\u00040\0 \u0004>\u0004=\0 \u00045\u0004Q\0 \u0004C\u00041\u00048\u0004;\0,\0 \u00047\u00040\u0004:\u0004>\u0004?\u00040\u0004;\0 \u00045\u0004Q\0 \u00042\0 \u0004<\u0004>\u00043\u00048\u0004;\u0004C\0 \u0004=\u00040\0 \u0004<\u0004>\u00043\u00048\u0004;\u00045\0 \u0004=\u00040\u0004?\u00048\u0004A\u00040\u0004;\0,\0 \u0004C\0 \u0004?\u0004>\u0004?\u00040\0 \u00041\u0004K\u0004;\u00040\0 \u0004A\u0004>\u00041\u00040\u0004:\u00040\0 \u0004>\u0004=\0 \u00045\u0004Q\0 \u0004;\u0004N\u00041\u00048\u0004;\0.\0.\0."

SergeyPechenik
Posts: 7
Joined: Tue 05 Mar 2019 18:59

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by SergeyPechenik » Thu 28 Mar 2019 11:54

One more thing!

I just updated DbForge and now all strings looks the same like in new dotConnect, but in SQL Developer strings looks like it was in older version of dbForge.

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

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by Shalex » Thu 04 Apr 2019 16:49

SergeyPechenik wrote:I just updated DbForge and now all strings looks the same like in new dotConnect, but in SQL Developer strings looks like it was in older version of dbForge.
1. You mean that now the same problem persists with both dotConnect for Oracle and dbForge Studio for Oracle products, don't you?

2. Could you try connecting with dotConnect for Oracle v9.6.725 in the OCI mode (via Oracle Client)? Does the problem occur in this case as well?

3. Specify your value of NLS_NCHAR_CHARACTERSET.

SergeyPechenik
Posts: 7
Joined: Tue 05 Mar 2019 18:59

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by SergeyPechenik » Fri 05 Apr 2019 08:42

1) Yes, Exactly.

2) In OCI Mode everything fine

3) NLS_NCHAR_CHARACTERSET = UTF8

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

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by Shalex » Fri 12 Apr 2019 19:46

We are investigating the issue.

TheGramix
Posts: 10
Joined: Fri 14 Jan 2011 06:14

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by TheGramix » Fri 26 Apr 2019 10:11

Hello,
any news about this issue? I have the same problem on my oracle 12c :-(

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

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by Shalex » Fri 26 Apr 2019 11:29

We have reproduced the bug with Oracle 12c (NLS_NCHAR_CHARACTERSET=UTF8). It occurs when the value is passed as a plain text to NVARCHAR2 column, in case of using a parameter it works. We will notify you when the issue is fixed.
TheGramix wrote: Fri 26 Apr 2019 10:11 any news about this issue? I have the same problem on my oracle 12c :-(
Please specify the full version, edition of your Oracle 12c and its value of NLS_NCHAR_CHARACTERSET.

TheGramix
Posts: 10
Joined: Fri 14 Jan 2011 06:14

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by TheGramix » Tue 30 Apr 2019 05:34

Hello,
my Oracle is 12.1.0.2.0 and NLS_NCHAR_CHARACTERSET is UTF8.
I tried to use your Entity Developer 6.3.631 to create my model, I don't use any parameter at the moment, just a "Retrieve data" from a table with NVARCHAR2 columns.

Many thanks!

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

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by Shalex » Sat 04 May 2019 08:28

The investigation is in progress. Once the issue is fixed, we will notify you.

seb1487
Posts: 23
Joined: Fri 24 Jun 2016 10:27

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by seb1487 » Fri 10 May 2019 05:26

Hi,
i have the same issue. The Bug exists since version 9.6.646 and only with NLS_NCHAR_CHARACTERSET=UTF8.

Greetings,
seb1487

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

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by Shalex » Thu 16 May 2019 14:25

* The bug with inserting a long string into the VARCHAR2 column on Oracle Server with NLS_CHARACTERSET=UTF8 in the Direct mode is fixed
* The bug with reading data from the NVARCHAR2 column on Oracle Server with NLS_NCHAR_CHARACTERSET=UTF8 in the Direct mode is fixed

The internal build with the fix is available at https://www.devart.com/pub/nuget_oracle_9_7_756.zip.

We will notify you when the new public build is available for download.

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

Re: Encoding problem with Oracle 12c after update to 2.2 EF core

Post by Shalex » Fri 07 Jun 2019 18:11

New build of dotConnect for Oracle 9.7.770 is available for download now: viewtopic.php?f=1&t=38884.

Post Reply