Converts a sequence of multibyte characters into a sequence of corresponding wide-character codes.
#include <stdlib.h> size_t mbstowcs (wchar_t *pwcs, const char *s, size_t n);
This function is affected by the LC_CTYPE category of the program's current locale. If copying takes place between objects that overlap, the behavior is undefined.
x | The number of array elements modified or required, not included any terminating zero code. The array will not be zero-terminated if the value returned is n. If pwcs is the NULL pointer, mbstowcs returns the number of elements required for the wide-character array. |
(size_t) -1 | Indicates that an error occurred. The function sets errno to EILSEQ - Invalid character detected. |