Page 1 of 1

[patch_done] Setting up Unicode connection with Zeos 7

Posted: 16.07.2011, 23:00
by KingS
Hello,

today I switched to Zeos 7 (SVN-Builds) in order to use Delphi 2009. But now I have some questions because I have to convert the strings from/to database - and I don't know why. Data will be stored correctly, but when I load data from DB "Müller" becomes mostly unreadable (you know what I mean ;)

Firstly, my settings/environment:

Code: Select all

Database: Firebird 2.1
Collate/Charset: UTF8
ZConnection.Properties.Add('codepage=utf8');
ZQuery.Properties.Add('codepage=utf8');
That's all I had to set up.

How I store data:

Code: Select all

...VALUES (:data1, :data2, :data3.......
ZQuery.ParamByName('data1').AsString:='äöü';
Remember: In Database "äöü" is stored correcty.

How I read data:

Code: Select all

...SELECT * FROM ....
result:=ZQuery.FieldByName('test1').AsString;
The result from the read-function is "string" (Delphi 2009)

This will end up in encoding-display-errors. When I convert with "UTF8ToString", everything is fine.

Is this behaviour correct?

Thanks in advance!

Posted: 17.07.2011, 16:41
by mrLion
try fieldByName().AsWideString ????

Posted: 18.07.2011, 21:43
by ism
What sql server, what encoding tables ?

Posted: 18.07.2011, 22:00
by seawolf
They are talking about firebird

Posted: 20.07.2011, 21:13
by ism
For delphi maybe for example
codepage=cp1251
for russian text

Posted: 08.04.2012, 12:05
by EgonHugeist