Application programming guidelines for handling different encoding schemes

The Db2 ODBC driver determines whether an application is an EBCDIC, Unicode, or ASCII application by evaluating the CURRENTAPPENSCH keyword in the initialization file. You must compile your application with a compiler option that corresponds to this setting.

Specify corresponding encoding schemes for the Db2 ODBC driver and your application, by performing the following actions:
  1. Set the CURRENTAPPENSCH keyword in the initialization file to EBCDIC, UNICODE, or ASCII, or to a CCSID from which the driver derives the encoding scheme. EBCDIC is the default.
  2. Compile the application in EBCDIC, Unicode (with either the UTF-8 or UCS-2 compiler option), or ASCII.
You should specify the same encoding scheme with both of these actions.

When you write ODBC applications, you also need to choose API entry points and bind host variables to C types that are appropriate for the encoding scheme of your application.