Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

errno_t _strlwr_s(char* str, size_t sizeInBytes);

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

errno_t _wcslwr_s(wchar_t* str, size_t sizeInWords);

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

Internationalization (I18n) Function Overview

The _strlwr_s function is a secure version of _strlwr. 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 _strlwr_s function converts any uppercase characters in str to lowercase 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.

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

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

_tcslwr_s is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _mbslwr_s or _wcslwr_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