> # Developing ODBC Applications on Linux/UNIX

> It is important to remember some differences in developing applications on Linux/UNIX:

> - "Using Double-Byte Character Sets on Linux/UNIX"
> - "Using UTF-16 for your Applications on Linux/UNIX"

> ### Using Double-Byte Character Sets on Linux/UNIX

> The SequeLink 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 SequeLink Client 6.0 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

> ### Using UTF-16 for your Applications on Linux/UNIX

> Because the DataDirect Driver Manager allows applications to use either UTF-8 or UTF-16 Unicode encoding, this means that applications written in UTF-16 for Windows platforms can now also be used on Linux and UNIX platforms.

> The Driver Manager assumes a default of UTF-8 applications; therefore, two things must occur for it to determine that the application is UTF-16:

> - The definition of SQLWCHAR in the ODBC header files must be switched from char * to short *. To do this, the application uses #define SQLWCHARSHORT.
> - The application must set the ODBC Environment Attribute SQL_ATTR_APP_UNICODE_TYPE to a value of SQL_DD_CP_UTF16.