TStringField instead of TWideStringField

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jaska45
Posts: 28
Joined: Fri 23 Dec 2005 03:55

TStringField instead of TWideStringField

Post by jaska45 » Tue 21 Aug 2012 18:26

I have a SQLite database. All SQLite databases store string as Unicode (UTF-8 or UTF-16). If I uses the database by using TUniTable all string fields are TStringField instead of TWideStringFields. The text fields should be TWideStringFields so that I read and write the field value as Unicode.

Is this a bug in UniDac? I am using the newest UniDac with Delphi XE2.

Best regards,
Jaska
Last edited by jaska45 on Wed 22 Aug 2012 03:22, edited 1 time in total.

jaska45
Posts: 28
Joined: Fri 23 Dec 2005 03:55

Re: TStringField instead of TWideStringField

Post by jaska45 » Wed 22 Aug 2012 03:22

I solved this. You need to set UseUnicode to true

Connection.SpecificOptions.Values['UseUnicode'] := 'True';

Why is this needed? SQLite stores only Unicode text and Unicode support should be turned on by default?

Another question. I used other databases too. Should I set UseUnicode option True when working on any database?

Jaska

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TStringField instead of TWideStringField

Post by AlexP » Wed 22 Aug 2012 14:31

hello,

The default value of UseUnicode is False for all DAC products and for UniDAC specifically, and we cannot change the value of this option, since this will be changing of the behaviour, and projects created on previous versions won't work or will work incorrectly when updating our products.
If you need to use TWideString fields in any of DBs, you should set this parameter to True.

Post Reply