Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-115
mbstowcs
mbstowcs
The mbstowcs function converts a sequence of multibyte characters to a corresponding
sequence of wide characters.
pwcs
points to the array that will contain the sequence of wide characters.
s
points to the array that contains the sequence of multibyte characters. No multibyte
characters that follow a null character will be examined or converted. The multibyte
characters pointed to by s must be in the initial shift state.
n
specifies the maximum number of bytes that will be modified in the array pointed to
by pwcs.
Return Value
(size_t) -1 if an invalid multibyte character is encountered.
Otherwise, the function returns the number of array elements copied to pwcs. If a
null terminator is present, it is not included in this count.
Usage Guidelines
•
The mbstowcs function is affected by the LC_CTYPE category of the current locale.
#include <stdlibh>
size_t mbstowcs(wchar_t *pwcs, const char *s, size_t n);