インテル® Fortran コンパイラー 19.0 デベロッパー・ガイドおよびリファレンス
NLS Function: Sets the current language, country, or codepage.
USE IFNLS
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. |
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:
NLS$ErrorInvalidLanguage - language is invalid or not supported
NLS$ErrorInvalidCountry - country is invalid or is not valid with the language specified
NLS$ErrorInvalidCodepage - codepage is invalid or not installed on the system
NLSSetLocale works on installed locales only. Many locales are supported, 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( ).