skip to main content
Developing ODBC Applications for Internationalization : Unicode and Non-Unicode ODBC Drivers : Function Calls
 

Function Calls

Instead of the standard ANSI SQL function calls, such as SQLConnect, Unicode applications employ W (wide) function calls, such as SQLConnectW. If the driver is a true Unicode driver, it can understand the "W" function calls and the Driver Manager can pass them through to the driver without conversion to ANSI. The OpenAccess Client for ODBC (the ODBC Client) and the Local ODBC Client are Unicode drivers.
Non-Unicode drivers cannot understand the W function calls; therefore, the Driver Manager must convert them to ANSI calls before sending them to the driver. The Driver Manager determines the ANSI encoding system to which it must convert by referring to a code page. On Windows, this reference is to the Active Code Page. On Linux/UNIX, it is to the IANAAppCodePage connection string attribute, part of the odbc.ini file.
The following examples illustrate the conversion streams. The Driver Manager on Linux and UNIX prior to OpenAccess SDK Client 8.1 for ODBC assumes Unicode applications and Unicode drivers that use the same encoding (UTF-8). For OpenAccess SDK Client 8.1 for ODBC on Linux/UNIX, the Driver Manager determines the type of Unicode encoding of both the application and the driver, and performs conversions when the application and driver each use different types of encoding. This determination is made by checking two ODBC Environment Attributes: SQL_ATTR_APP_UNICODE_TYPE and SQL_ATTR_DRIVER_UNICODE_TYPE.