special character insertion issue with PostgreSQL database

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
shubham15
Posts: 6
Joined: Thu 27 Jan 2022 07:34

special character insertion issue with PostgreSQL database

Post by shubham15 » Fri 01 Apr 2022 06:14

Hello all,

We are switching to Dot connect for PostgreSQL from another provider (Oracle). After switching to Dot Connect for PostgreSQL from oracle when we try to insert data (some special character), we can see the wrong data getting inserted in the table. example in Oracle we had one column with data ("PÖN") but in PostgreSQL same data is storing as("PÖN").

Now, we are curious about if there is a way to specify target data type for all specific data types. or is there any solution for this. or do we need to do some property changes for our PostgreSQL Db.

Regards

DmitryGm
Devart Team
Posts: 152
Joined: Fri 11 Dec 2020 10:27

Re: special character insertion issue with PostgreSQL database

Post by DmitryGm » Sun 01 May 2022 18:10

Most likely you need to set "Unicode=True;" in the connection string.
  • Unicode - If true, sets client charset to UTF8 and converts client data according to this charset. Default value is false in the assemblies for Full .NET Framework, but true for .NET Standard compatible assemblies.

If you need a specific character set use "Character Set" ConnectionString Property.
  • Character Set - A character set used by the client. Actually, if this property is enabled, then the "SET NAMES <Charset>" query is executed on establishing a connection. Default value is an empty string. That means there is no action performed with charset on the client and on the server.

Post Reply