The ASE server can be configured to store character data in a specific charset. When the ODBC Driver connects to the ASE server, the server and the driver negotiate a charset. Then, the driver and the server exchange multibyte data in the negotiated charset. The ASE ODBC driver determines the charset depending on the platform:
On Windows, the ASE ODBC Driver by default negotiates the same default charset as the ASE server. The default charset is ServerDefault. However, if you want to use the ClientDefault charset, you need to specify the value for the CodePageType property, which can be ANSI or OEM. The default is ANSI. You can also specify a User specified charset by specifying a valid ASE charset for the Charset connection property.
On Linux, the ASE ODBC Driver by default examines the LC_CTYPE and LANG environment variables. If they are not set, it defaults to ISO 8859-1. If one of these environment variables are set, it then looks for locales.dat in the $SYBASE/locales/locales.dat directory to pickup the corresponding ASE charset. If the file is not found, it then looks into its own map in memory to lookup the corresponding ASE charset.
During login, the driver then negotiates this client charset. This behavior can be overwritten by specifying the CharSet connection property to a valid ASE charset or "ServerDefault." When set to "ServerDefault," the driver behavior is the same as in the Windows platform. You can also specify a User specified charset by specifying a valid ASE charset for Charset connection property.