Page 1 of 1

UniDac for MySQL and Unicode

Posted: Fri 13 Nov 2009 10:59
by upscene
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

Posted: Fri 13 Nov 2009 11:10
by Plash
In Delphi 2009 TStringField contains AnsiString like in all other Delphi versions.

Posted: Fri 13 Nov 2009 11:19
by upscene
Oh :(

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

Posted: Mon 16 Nov 2009 08:59
by Plash
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.