Unicode database support in Tiburon for Delphi and C++

In Tiburon, the next versions of Delphi and C++Builder, there is full support for Unicode throughout the language, the compiler, the runtime library, and the VCL. The basic String type is now a UnicodeString. As part of the Unicode support, there is also full support for Unicode characters in databases and database components. While Delphi and C++Builder have supported Unicode characters at the database level for some time, you know can use all of the VCL components to display and manipulate the Unicode characters.

I have an InterBase database from demos I did back when we first added support for Unicode in our DBX3 driver days. The database contains English, Greek, Hebrew, and Chinese strings in the CharField column. I create a VCL application with some database components: SQLConnection, SQLDataSet, DataSetProvider, ClientDataset, DataSource, DBGrid and DBLabel.

There are two ways to get a program to work with the Unicode database. 1) Open SQLConnection’s "params" property in the Object Inspector and create the name=value pair "ServerCharSet=UTF8". Then right mouse click on the SQLConnection component and choose "Refresh Connection String". Set the Connection active and now I have Unicode Characters in the DBGrid. 2) Modify the DBXConnections.xml file for your database connection to add "ServerCharSet=UTF8".

image10_654.jpg

Here is the resulting VCL application form at design time:

image11_656.jpg

Stay tuned to the developer network for Tiburon video previews. Also stay tuned to the CodeGear blogs for other employees who will preview Tiburon technologies.