Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Locating
localization information [Table of Contents] Macros

Open Client Client-Library/C Reference Manual

[-] Chapter 2 Topics
[-] International Support
[-] The locales file

The locales file

The Sybase locales file associates locale names with languages, character sets, and sort orders. Open Client/Server products use the locales file when loading localization information.

The locales file directs Open Client/Server products to language, character set, and sort order names, but does not contain actual localized messages or character set information.

For more information about the locales file, see the Open Client/Server Configuration Guide.

Locales file entries

The locales file has platform-specific sections, each of which contains entries of the form:

locale = locale_name, language, charset,
sortorder

sortorder is an optional field. If not specified, the sort order for the specified locale defaults to binary.

Each entry defines a locale name by associating it with a language, character set, and sort order.

For example, a section of the locales file might contain the following entries:

locale = default, us_english, iso_1, dictionary
 locale = fr, french, iso_1, noaccents
 locale = japanese.sjis, japanese, sjis

These entries indicate that:

Sybase predefines some locale names by including entries for them in the locales file. If these entries do not meet your needs, you may either modify them or add entries that define new locale names.

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:

  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.


Locating
localization information [Table of Contents] Macros