TZUpdateSQL Param and Unicode

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
royyu
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 17.10.2014, 15:56

TZUpdateSQL Param and Unicode

Post by royyu »

I am using ZeosLib 7.1 + Delphi 2009 + DevExpress Component. I am trying to input some Traditional Chinese into the SQLite DB. However, some words such as '當歸' will become something else like 'vuxk' after saved. So I try to add a TZUpdatesSQL and write my own update SQL.

I found that if I write the update SQL using param like:
update tableA set fieldA = :paramA;
,then the word can't be save correctly.

If I write the update SQL like:
update tableA set fieldA = '當歸';
, then it works. But I need to update multi-records in one time, so I can't write the update SQL like that.

My TZConnection setting:
ClientCodepage = UTF-8
ControlsCodePage = cCP UTF16
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: TZUpdateSQL Param and Unicode

Post by EgonHugeist »

Works on my side. Which 7.1 are you using for? Current is 7.1.4

Is the Parameter of TZUpdateSQL type of ftWideString?

Note use TField/TParam.AsWideString NOT AsString. D2009 boils the encoding down to Ansi. If your native lang/OS-codepage isn't compatible to the characters you'll got a data-loss. This behavior is fixed since D2010.
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
Post Reply