UniDac for MySQL and Unicode

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

UniDac for MySQL and Unicode

Post by upscene » Fri 13 Nov 2009 10:59

Hi,

I'm trying out Unicode with UniDac and I have a question --

For the MySQL connection, I set the "Charset" property to UTF8, yet the data is displayed wrong.

If I set UseUnicode to True, it's alright (TWideStringField).

I'm using Delphi 2009 though, so I'm surprised the UTF8 charset doesn't work. With UseUnicode = False, a TStringField is created, but in D2009, this should be fine, should it not?

With regards,

Martijn Tonies
Upscene Productions

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 13 Nov 2009 11:10

In Delphi 2009 TStringField contains AnsiString like in all other Delphi versions.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Post by upscene » Fri 13 Nov 2009 11:19

Oh :(

But with charset = UTF8 in the connection options and the column charset = UTF8, shouldn't a WideStringField be created for the column?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 16 Nov 2009 08:59

With CharSet = UTF8 UniDAC returns data in the UTF-8 encoding. WideString uses UTF-16 encoding. You need to set UseUnicode = True to UniDAC decode data from UTF-8 to UTF-16.

Post Reply