Derivation of locales in application programs

Locales are implemented one way on Windows and another way on Linux® and UNIX systems. There are two locales on Linux and UNIX systems:
  • The environment locale allows you to specify the language, currency symbol, and so on, that you want to use.
  • The program locale contains the current language, currency symbol, and so on, of a program that is running.

On Windows systems, cultural preferences can be set through Regional Settings on the Control Panel. However, there is no environment locale like those on Linux and UNIX systems.

When your program is started, it gets a default C locale. It does not get a copy of the environment locale. If you set the program locale to any locale other than C, Db2® database system uses your current program locale to determine the code page and territory settings for your application environment. Otherwise, these values are obtained from the operating system environment. Note that setlocale() is not thread-safe, and if you issue setlocale() from within your application, the new locale is set for the entire process.