![]() | ![]() |
Home |
|
|
Open Client Client-Library/C Reference Manual |
|
| Chapter 2 Topics |
|
| International Support |
|
| 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 entriesThe 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:
When a locale name of "default" is specified, a language of "us_english," a character set of "iso_1," and a sort order of "dictionary" should be used.
When a locale name of "fr" is specified, a language of "french," a character set of "iso_1," and a sort order of "noaccents" should be used.
When a locale name of "japanese.sjis" is specified, a language of "japanese," a character set of "sjis," and a sort order of "binary" (the default sort order) should be used.
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 fileBefore 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:
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/Server Configuration Guide.
Looks up the locale name in the locales file to determine which language, character set, and sort order are associated with it.
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.
|
|