SourcePro DB fully supports the Unicode data standard. This functionality allows you to move Unicode data to and from your Unicode-enabled database. Please refer to your DB2 documentation for how to create a Unicode database.
The DB Access Module for DB2 CLI fetches string data into the string type used for the result column by the database client. If your application uses a UTF-16 code page, it is recommended that you enable
RWDBDB2CLILibEnvironmentHandle::unicodeMode() so that all character types bind to the type
RWBasicUString instead of
RWCString.
Using
RWBasicUString or its derived class
RWUString (from the SourcePro Core Internationalization Module) to handle all UTF-16 character data avoids costly conversions from UTF-16 to UTF-8. Please refer to section
“System and Environment Handles to DB2 CLI Specific Resources” for more information on
RWDBDB2CLILibEnvironmentHandle.
This section defines any limitations relevant to the DB Access Module for DB2 CLI and SourcePro DB.
SourcePro DB does not support Unicode logins, passwords, or metadata.
Due to platform inconsistencies, Rogue Wave recommends that you do
not write Unicode applications using
RWWString with character and graphic data. On platforms where a
wchar_t is defined as greater than 2 bytes, a costly conversion will occur to convert your data from 2-byte UTF-16 to 4-byte padded UTF-16. Furthermore, after the conversion, your application will still not have valid Unicode. Whether the size of
wchar_t is 2 bytes or 4 bytes, the
RWWString will represent only UTF-16 data, not a true wide string, as it has not been localized. Rogue Wave recommends using one of our Unicode string containers,
RWBasicUString (from the Essential Tools Module) or
RWUString(from the Internationalization Module).