[patch_done] Setting up Unicode connection with Zeos 7

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
KingS
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 16.07.2011, 22:46

[patch_done] Setting up Unicode connection with Zeos 7

Post 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!
mrLion
Senior Boarder
Senior Boarder
Posts: 71
Joined: 20.03.2010, 10:17

Post by mrLion »

try fieldByName().AsWideString ????
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

What sql server, what encoding tables ?
Lazarus 1.0.8 fpc 2.6.0
seawolf
Zeos Dev Team *
Zeos Dev Team *
Posts: 385
Joined: 04.06.2008, 19:50
Contact:

Post by seawolf »

They are talking about firebird
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

For delphi maybe for example
codepage=cp1251
for russian text
Lazarus 1.0.8 fpc 2.6.0
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Locked