cs_locale and the locales file

Before using a CS_LOCALE structure to set custom localization values for a context, connection, or data element, a Client-Library application must call cs_locale to load the CS_LOCALE with the desired localization values.

In loading the CS_LOCALE structure, cs_locale:

  1. Determines what to use as a locale name:

    • If cs_locale’s buffer parameter is supplied, this is the locale name.

    • If cs_locale’s buffer parameter is NULL, cs_locale performs a platform-specific operating system search for a locale name. For information about this search, see the Open Client and Open Server Configuration Guide for your platform.

  2. Looks up the locale name in the locales file to determine which language, character set, and sort order are associated with it.

  3. Loads the type of information specified by the type parameter into CS_LOCALE. For example, if type is CS_LC_CTYPE, cs_locale loads character set information. If type is CS_LC_MESSAGE, cs_locale loads message information.