TZUpdateSQL Param and Unicode

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

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

TZUpdateSQL Param and Unicode

Postby royyu » 22.10.2014, 14:19

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 Dev Team
Zeos Dev Team
Posts: 1731
Joined: 31.03.2011, 22:38

Re: TZUpdateSQL Param and Unicode

Postby EgonHugeist » 27.10.2014, 10:53

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.
King regards, Michael

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

Image


Return to “SQLite”

Who is online

Users browsing this forum: No registered users and 1 guest