Is it possible to tweak TStringField to work like TWideStringField in Delphi?

Posted by mjustin on Stack Overflow See other posts from Stack Overflow or by mjustin
Published on 2010-03-23T14:07:48Z Indexed on 2010/03/23 17:03 UTC
Read the original article Hit count: 662

We want to use Unicode with Delphi 2009 and Interbase, and found that to switch the character encoding from WIN1252 to UNICODE_FSS we first have to replace all instances of TStringField with TWideStringField in all datamodules. For around 60 datamodules, we can not simply do this over one weekend. I can see only two options for a migration strategy:

  • find a workaround which allows to use the existing TStringField fields without triggering the 'expected: TWideStringField' error

or

  • remove all persistent fields to avoid the string type conflict

As far as I know the field types for persistent database fields are registered in some kind of class registry. Could we use this to make Delphi believe that a TStringField is ok for a Interbase character column with UNICODE_FSS encoding?

Or can we use a commercial dbExpress driver which work with TStringField in both cases?

See also my related question: http://stackoverflow.com/questions/2302670/delphi-dbexpress-and-interbase-unicode-migration-steps-and-risks

© Stack Overflow or respective owner

Related posts about delphi

Related posts about interbase