UTF 8 error

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
Posts: 10
Joined: Mon 29 Mar 2010 16:26

UTF 8 error

Post by felipeiw » Mon 29 Mar 2010 16:45

Using delphi 7 with PG 8.4 Database configuration:
LC_COLLATE: Portuguese, Brazil
LC_CTYPE: Portuguese, Brazil

When ApplyUpdates(0) with caract, return error:
SQL Server Error: invalid byte sequence for encoding "UTF8": 0xd652

how to fix it ?

I'm using DBXCONNECTIONS.INI for configure.



Devart Team
Posts: 643
Joined: Fri 12 Mar 2010 07:55

Post by bork » Tue 30 Mar 2010 14:35

The problem is that dbExpress driver uses "UTF8" encoding by default. To solve your issue you should set correct charset for your TSQLConnection.

You can use two ways to define charset:

1. To define charset charset as it is described in the "Readme.html" file:

coCharset = TSQLConnectionOption(204);

do it in the AfterConnect event of TSQLConnection:
SQLConnection1.SQLConnection.SetOption(coCharset, Integer(PChar('Your_CharSet')));

2. Set the parameter in the Params property of TSQLConnection component or in the "DBXCONNECTIONS.INI" file:


Post Reply