skip to main content
Developing ODBC Applications for Internationalization : Developing ODBC Applications on Linux/UNIX : Using Double-Byte Character Sets on Linux/UNIX
 

Using Double-Byte Character Sets on Linux/UNIX

The OpenAccessSDK for ODBC UNIX drivers can use double-byte character sets. The drivers normally use the character set defined by the default locale C unless explicitly pointed to another character set. The default locale C corresponds to the 7-bit USASCII character set.
Use the following procedure to define a different character set for the locale:
1. Add the following line at the very beginning of applications that use double-byte character sets:
setlocale (LC_ALL, "");
The setlocale(LC_ALL, "") function selects the program's entire locale and may be used to change the program's entire local. The "" corresponds to the value of the associated environment variables, LC_* and LANG. If this line is not present, the default locale C is used. If this line is present and if LANG or LC_TYPE is set, the locale character set is determined based on these values. LC_TYPE overwrites the LANG setting.
If LANG and LC_TYPE is either not set or is set to NULL, the default locale C is used.
2. Set the LC_CTYPE and/or LANG environment variable to the appropriate character set. The Linux/UNIX command locale -a can be used to display all supported character sets on your system.
For more information, see the man pages for locale and setlocale.
The OpenAccess Client 8.1 for ODBC ships the utility ivslkcheckcp to check the following information:
What value to choose for the IANAAppCodePage
What code page will be used by your application