Internationalization and localization tools


Locale-Sensitive Windows C++ Function

LPTSTR CharLower(LPTSTR lpsz);

LPSTR CharLowerA(LPSTR lpsz);

LPWSTR CharLowerW(LPWSTR lpsz);

Internationalization (I18n) Function Overview

The CharLower function converts the character string pointed to by lpsz to lowercase, based upon the system locale. If lpsz points to a null-terminated string, then the conversion is done in-place and the return is a pointer to the converted string. For lpsz to specify a single character, the high-order word of the argument must be zero, and the low-order word must contain the single character to be converted. In this case, CharUpper returns a 32-bit value whose high-order word is zero and low-order word contains the converted character.

CharLowerA is the narrow version of the function, passing and returning single or multibyte strings.

CharLowerW is the wide version of the function, passing and returning wide-character strings.

I18n Issues

Use the appropriate version of the function as required for internationalization support, noting the following:

A Windows MBCS application should not use CharLower unless the language identifier of the application's locale matches that of the System's default locale, i.e. the LANGID value returned from GetSystemDefaultLangID. This is not an issue for a Windows Unicode application; CharLower converts the UTF-16 encoded characters correctly.

Recommended Replacements*

When possible, use the Generic version of the function, rather than the narrow or wide versions, and let the Windows #define UNICODE switch determine which version of the function will be called.

*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