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.

http://www.devart.com/unidac/docs/pgsqlprov_article.htm


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -