PostgreSQL Character problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
farukdemirel
Posts: 4
Joined: Thu 30 Mar 2017 08:46

PostgreSQL Character problem

Post by farukdemirel » Thu 30 Mar 2017 08:49

Hi,
I am using unidac 6.4.16 21-Nov-16 with Delphi 10.1 Berlin.
My project uses MSSQL or POSTGRESQL 9.6 databases optionally.
Databases installed on a Win2012 R2 English Server. (DBSERVER)

My problem occurs only with PGSQL.

When I executed my program on DBSERVER computer with PGSQL and try to insert a string includes Turkish chars (ĞÜŞİÖÇğüşiöçı), some of those characters will be replaced as for example Ğ becomes G.

BUT

When I executed my program on any other computer that support Turkish Language no problem.

I tried to set connection objects specific options parameter as
UniConnection1.SpecificOptions.Values['PostgreSQL.Charset'] := 'WIN1254';
this partially sloves the problem (For Turkish).

It is not a good choice to set dynamically this parameter because, data to be inserted is coming from other computers via tcp/ip and my software inserts it to database.
There is always a chance to face with a data containing any language.

I need a true and generic solution that is not depended to any settings on any computer.

If you need additional info please tell me?

Best regards.

farukdemirel
Posts: 4
Joined: Thu 30 Mar 2017 08:46

Re: PostgreSQL Character problem

Post by farukdemirel » Thu 30 Mar 2017 12:53

Hi,
I found such a solution:
setting charset to UTF8 and UseUnicode to true seems that solves the problem.
Right?

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: PostgreSQL Character problem

Post by azyk » Tue 04 Apr 2017 09:55

The found solution (UseUnicode=True and Charset=UTF8) is right for correct displaying of national symbols.

Post Reply