Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - Database Administration » Configuring Your Database » International languages and character sets » Understanding locales


Understanding the locale character set

Both application and server locale definitions have a character set. The application uses its character set when requesting character strings from the database server. The database server compares the database character set with that of the application to determine whether character set conversion is needed. If the database server cannot convert to and from the client character set, the connection fails.

  1. If the SACHARSET environment variable is set, its value is used to determine the character set. See SACHARSET environment variable.

    The database server uses SACHARSET only when creating new databases, and then only if no collation is specified.

  2. If the connection string specifies a character set, it is used. For more information, see CharSet connection parameter [CS].

  3. Open Client applications check the locales.dat file in the locales subdirectory of the Sybase release directory.

  4. Character set information from the operating system is used to determine the locale:

    • On Windows operating systems, the current Windows ANSI code page is used.

    • On Unix platforms, the following Locale Environment Variables are examined, in the specified order: LC_ALL, LC_MESSAGES, LC_CTYPE, LANG. For the first of these environment variables found to be set, its value is used to determine the character set. If the character set cannot be determined from the operating system, the default of iso_1 (also referred to as Windows code page 28591, ISO 8859-1 Latin I, ISO 8859-1 Latin-1, or iso_8859-1:1987) is used.

  5. On any other platform, a default code page cp1252 is used.

For more information about how to find locale settings, see Determining locale information.