Jump to content
Max Terentiev

Control TDataSet strings encoding (auto encode to utf-8)

Recommended Posts

Posted (edited)



I moving my project from D2007 to Rio. My project uses ElevateSoftware DBISAM database engine. I was very happy with it but it's not support unicode and I got problems with saving string data from new unicode-enabled delphi controls to TDBISAMTable: i got ???? instead of unicode symbols. I can handle this problem by manually encode/decode string fields values to/from UTF8. But I need to do it in several thousands places in my code :((((


Maybe somebody already found elegant solution for this problem ? Maybe overriding some methods in TDataSet ?


I found TStringField.Transliterate and TDataSet.Translate it's almost that I need but function


function TDataSet.Translate(Src, Dest: PAnsiChar; ToOem: Boolean): Integer;


have PAnsiChar params and I have data loss (???? instead of unicode) here, so I can't use it for background UTF8 conversions. But I need something similar !


Thanks for help !

Edited by Max Terentiev

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now