Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

errno_t _strupr_s(char* str, size_t sizeInBytes);

errno_t _mbsupr_s(unsigned char* str, size_t sizeInBytes);

errno_t _wcsupr_s(wchar_t* str, size_t sizeInWords);

errno_t _tcscmp_s(const _TXCHAR* str, size_t sizeInBytesOrWords);

Internationalization (I18n) Function Overview

The _strupr_s function is a secure version of _strupr. Upon security errors, it will invoke an invalid parameter handler routine, and/or return an error code. For details please see the relevant MSDN documentation.

The _strupr_s function converts any lowercase characters in str to uppercase letters, using the LC_CTYPE category setting of the current locale, and returning an error code in the event of an error. sizeInBytes is the size of the str buffer.

_mbsupr_s is the multibyte version of _strupr_s. The argument str is a multibyte-character string and sizeInBytes is the byte length of the string buffer.

_wcsupr_s is the wide version of _strupr_s. The argument str is a wide-character string and sizeInWords is the word length of the wide-character string buffer.

_tcsupr_s is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _mbsupr_s or _wcsupr_s.

I18n Issues

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

Ensure that the current locale is set properly.

Special care must be taken with the size parameters. See Locale-Sensitive Length Functions for a complete discussion of the issues involved with functions that pass length parameters.

Recommended Replacements*

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

Locale-Sensitive C/C++ String Operation Functions

 

Lingoport internationalization and localization services and software