Internationalization and localization tools


Multibyte and Wide Character Conversion Function

size_t mbstowcs(wchar_t *wcstr, const char *mbstr, size_t count);

Internationalization (I18n) Function Overview

The mbstowcs function converts a sequence of multibyte characters stored in mbstr to a corresponding sequence of wide characters in wcstr. It limits the conversion to no more than count multibyte characters, returning the number of converted multibyte characters if successful; else -1 in the event of an error. If wcstr is NULL, the function returns the required size of the destination string. If the return value is count, the wide-character string is not null-terminated.

I18n Issues

Prior to calling mbstowcs, ensure that the current locale is set correctly.

Recommended Replacements*

There are no variations of this conversion function.

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

Multibyte and Wide Character Conversion Functions

 

Lingoport internationalization and localization services and software