Delphi XE and SQL encoding

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
tygrys
Junior Boarder
Junior Boarder
Posts: 33
Joined: 09.12.2005, 18:31
Location: Poland

Delphi XE and SQL encoding

Post by tygrys »

On some database configuration 7.0 does not work well.

ie. I have Firebird 1.5 database with win1250 encoding internaly. I'm also using polish windows (that means win1250 ansi internal) and I set connection properties to codepage=win1250.

It works fine under delphi 2006, but under XE it destroys native characters in database table on insert/update when using direct SQL.
Reading from database is ok.

Statement: INSERT INTO TABLE VALUES('ąęść')
produces junk in the field. This is due to ZEOS converting the SQL to UTF8 no mater the actual connection encoding.

Statement INSERT INTO TABLE VALUES(:value)
and setting ZQuery.Params[0] := 'ąęść' works ok, and inserts/updates using that method works ok, as all data aware components too.

I think we need some logic to use utf8 encoding when talking with database, not just {$IFDEF DELPHI_12UP}

Looking at sources - this is not only Firebird issue, but I haven't tested this elseware.

Tygrys
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Please, see my answer on http://zeos.firmos.at/viewtopic.php?t=2984

Mark
Image
Locked