Locale-Sensitive Windows C++ Function
DWORD CharUpperBuff(LPTSTR lpsz, DWORD cchLength);
DWORD CharUpperBuffA(LPSTR lpsz, DWORD cchLength);
DWORD CharUpperBuffW(LPWSTR lpsz, DWORD cchLength);
Internationalization (I18n) Function Overview
The CharUpperBuff function converts up to cchLength TCHAR characters in the buffer pointed to by lpsz
to uppercase, based upon the system locale,
and returns the number of characters converted.
CharUpperBuffA is the narrow version of the function, passing in a single or multibyte string and the number of bytes to convert, and returning the number of bytes converted.
CharUpperBuffW is the wide version of the function, passing in a wide-character string and the number of wide characters (WCHARs ) to convert, and returning the number of wide characters converted.
I18n Issues
Use the appropriate version of the function as required for internationalization support, noting the following:
A Windows MBCS application should not use CharUpperBuff 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; CharUpperBuff converts the UTF-16 encoded characters correctly.
Ensure that cchLength is correct for the chosen platform; bytes for the narrow version and WCHARs for the wide version. See Locale-Sensitive Length Functions
for a discussion on multibyte and wide character sizes.
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.
|