Page 1 of 1

TZUpdateSQL Param and Unicode

Posted: 22.10.2014, 14:19
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

Re: TZUpdateSQL Param and Unicode

Posted: 27.10.2014, 10:53
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.