Page 1 of 1

Delphi XE and SQL encoding

Posted: 31.10.2010, 21:12
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

Posted: 07.11.2010, 23:52
by mdaems
Please, see my answer on http://zeos.firmos.at/viewtopic.php?t=2984

Mark