Unicode in an ODBC application

View the typical ODBC application architecture.

The following diagram shows the architecture of a typical ODBC application with a driver manager and the HCL OneDB™ ODBC Driver.
Figure 1: Typical ODBC application architecture

This graphic illustrates a typical ODBC Application architecture. The illustration is composed of four boxes arranged in a horizontal line and connected by three dual-directional arrows. The box on the left is labeled "Application" and has the phrase "ANSI or Unicode" underneath it. The "Application" box is connected to a box labeled "Driver Manager DMR" which is connected to a box labeled "HCL OneDB ODBCDriver." The "HCL OneDB ODBCDriver" box is connected to the fourth box which is labeled "Database." The "Database box has the phrase "{UTF-8} or other locale" beneath it.

In this scenario, if an application calls to Unicode enabled APIs, then it must be connected to a Unicode enabled HCL OneDB ODBC Driver (Version 3.8 and later) to ensure that there is no loss of data. If the application calls to ANSI ODBC APIs, the application can be linked to either a Unicode enabled driver or an ANSI driver.

The HCL OneDB ODBC Driver continues to support HCL® OneDB GLS. Hence all data fetched in character buffers are fetched in the client locale code set. Only data fetched with wide character buffers use Unicode.

On Windows™, if the ODBC driver is not Unicode enabled, the ODBC Driver Manager maps all Unicode API function calls to ANSI ODBC APIs.

If the ODBC driver is Unicode enabled, the Windows ODBC Driver Manager (Version 4.10 or later) maps all ANSI ODBC APIs to Unicode ODBC APIs. The Data Direct (formerly Merant) driver manager for UNIX™ also works this way.
Important: In CSDK Version 2.70 there are two ODBC drivers. One with only ANSI APIs (called ANSI ODBC Driver, Version 3.34) and another with both ANSI and UNICODE APIs (called Unicode ODBC Driver, Version 3.80). For CSDK 2.80 and later, there is only one ODBC driver that supports both ANSI and UNICODE APIs.
Important: The HCL OneDB Driver Manager Replacement (DMR) for UNIX platforms does not map between Unicode and ANSI APIs.

For details about how the Windows ODBC driver manager handles mapping, see the section "Function Mapping in the Driver Manager" in the ODBC Programmer's Reference for Microsoft™.