Internationalization and localization tools


Locale-Sensitive C/C++ String Operation Function

errno_t _strlwr_s_l(char* str, size_t sizeInBytes, _locale_t locale);

errno_t _mbslwr_s_l(unsigned char* str, size_t sizeInBytes, _locale_t locale);

errno_t _wcslwr_s_l(wchar_t* str, size_t sizeInWords, _locale_t locale);

errno_t _tcslwr_s_l(const _TXCHAR* str, size_t sizeInBytesOrWords, _locale_t locale);

Internationalization (I18n) Function Overview

The _strlwr_s_l function is a secure version of _strlwr_l. 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_l function converts any uppercase characters in str to lowercase letters, using the LC_CTYPE category setting of the passed in locale, and returning an error code in the event of an error. sizeInBytes is the size of the str buffer.

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

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

_tcslwr_s_l is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _mbslwr_s_l or _wcslwr_s_l.

I18n Issues

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

Ensure that the correct locale is passed in.

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