Locales

Both the database server and the client library recognize their language and character set environment using a locale definition.

The application locale, or client locale, is used by the client or client library when making requests to the database server to determine the character set in which results should be returned, and the language of error messages, warnings, and other messages. The database server compares its own locale with the application locale to determine whether character set conversion is needed. Different databases on a server may have different locale definitions, and each client may have its own locale.

The locale consists of the following components:

  • Language   The language is a two-character string using the ISO 639-1 standard values (for example, DE for German). Both the database server and the client have language values for their locale.

    The database server uses the locale language to determine the language libraries to load. When creating a database, if no collation is specified, the database server also uses the language, together with the character set, to determine which collation to use.

    The client library uses the locale language to determine the language libraries to load, and the language to request from the database. See Locale language.

  • Character set   The character set is the code page, or encoding, in use. The client and server both have character set values, and they may differ. If they differ, character set conversion is used to enable interoperability. See Locale character set.


Locale language
Locale character set