NLS Function: Sets the current language, country, or codepage.
Module: USE IFNLS
Syntax
result = NLSSetLocale (language [, country] [, codepage])
language
(Input) Character*(*). One of the languages supported by the Windows* NLS APIs.
country
(Input; optional) Character*(*). If specified, characterizes the language further. If omitted, the default country for the language is set.
codepage
(Input; optional) INTEGER(4). If specified, codepage to use for all character-oriented NLS functions. Can be any valid supported codepage or one of the following predefined values (defined in IFNLS.F90
):
If you omit codepage, it defaults to NLS$WindowsLanguageCodepage. At program startup, NLS$WindowsEnvironmentCodepage is used to set the codepage.
Results
The result type is INTEGER(4). The result is zero if successful. Otherwise, one of the following error codes (defined in IFNLS.F90
) may be returned:
NLSSetLocale works on installed locales only. Windows systems support many locales, but they must be installed through the system Control Panel/International menu.
When doing mixed-language programming with Fortran and C, calling NLSSetLocale with a codepage other than the default environment Windows codepage causes the codepage in the C run-time library to change by calling C's setmbcp( ) routine with the new codepage. Conversely, changing the C run-time library codepage does not change the codepage in the Fortran NLS library.
Calling NLSSetLocale has no effect on the locale used by C programs. The locale set with C's setlocale( ) routine is independent of NLSSetLocale.
Calling NLSSetLocale with the default environment console codepage, NLS$ConsoleEnvironmentCodepage, causes an implicit call to the Windows API SetFileApisToOEM( ). Calling NLSSetLocale with any other codepage causes a call to SetFileApisToANSI( ).
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also