postgresql - Delphi edit unicode table data -
my delphi application using postgresql database (with unidac components). data stored in utf8 in database. read international characters, use handler:
procedure tdmmain.ongettext(sender: tfield; var text: string; displaytext: boolean); begin text := utf8decode (sender.asstring); end;
but, how possible store data, db? created handler, onsettext
, sender.asstring := utf8encode (text);
not working.
how possible that? thanks.
when reading , editing data, don't need recode utf-8 text (for example, in ongettext
event). enough set useunicode
option in tuniconnection.specificoptions
property true
, example, follows:
uniconnection1.specificoptions.values['postgresql.useunicode'] := 'true';
and unidac automatically.
Comments
Post a Comment