Internationalization and localization tools


Locale-Sensitive Windows C++ Function

BOOL IsCharUpper(TCHAR ch);

BOOL IsCharUpperA(CHAR ch);

BOOL IsCharUpperW(WCHAR ch);

Internationalization (I18n) Function Overview

The IsCharUpper function returns a non-zero value if the character ch is a valid uppercase character. This determination may be based on the semantics of the language selected by the user during setup or through the Control Panel. In the event of an error, or if the character is not uppercase, 0 is returned and extended error information can be obtained by calling GetLastError.

IsCharUpperA is the narrow version of the function, passing in a single or multibyte character.

IsCharUpperW is the wide version of the function, passing in a wide character.

I18n Issues

In an internationalized application, IsCharUpper should not be used for the following reasons:

An application that is compiled with the MBCS compiler flag will use the user's default language setting to test the semantics of the character. This is undesirable in an internationalized application, where the required language may vary and is independent of the system's settings.

Although an application that is compiled with the UNICODE compiler flag and running on a later version of Windows (WinNT/2K/XP) will obtain correct results when calling IsCharUpper on a Unicode character, there will still be a problem when running on Win95/98/ME platforms. This is because, similar to an MBCS application, the Microsoft Layer for Unicode, which allows a Unicode application to run on these non-Unicode platforms, will use the system's language rather than the program's language.

To work in both MBCS and Unicode UTF-16 environments, call _istupper which uses the program's settings when needed.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

Locale-Sensitive Windows C++ Functions

 

Lingoport internationalization and localization services and software