EPUB | CHM | PDF

FAQ - Question #7

Top Previous Next

Q. How to use Unicode data in my application?

A. Delphi/C++Builder support Unicode strings starting from 2009 version (Tiburon). DAC for MySQL supports Unicode data starting from v2.7.0. So, to support Unicode in your application you should use Delphi/C++Builder at least version 2009 and DAC for MySQL at least version 2.7.0.

Another issue for Unicode-enabled DB-applications is connection characterset. DAC for MySQL support Unicode strings only for UTF8 connection characterset. You have to set TMySQLDatabase.ConnectionCharacterSet property to 'utf8' to make DAC for MySQL represent strings as Unicode strings.

Connection character set can be UTF8 even if you don't set TMySQLDatabase.ConnectionCharacterSet property to 'utf8', e.g. if the server is configured to use UTF8 as default connection character set. You can use TMySQLDatabase.Utf8Used property to ensure that your application is connected to MySQL server using UTF8 connection character set.

If TMySQLDatabase.Utf8Used property value is False all strings are treated as sinlge-byte strings with ANSI encoding. Such ANSI-behaviuor is the same as for DAC for MySQL before 2.7.0 version.

 

Questions list

See also: TMySQLDatabase.ConnectionCharacterSet, TMySQLDatabase.Utf8Used properties