Converts a single multibyte character into the wide-character code that corresponds to that multibyte character.
#include <stdlib.h> int mbtowc ( wchar_t *pwc, const char *s, size_t n);
(OUT) Points to a wide-character code.
(IN) Points to the array of multibyte characters to be converted.
(IN) Specifies the number of bytes of the array pointed to by s to be examined.
If successful, returns the length in bytes of the multibyte character. Otherwise, returns 0 for any of the following conditions:
If a valid multibyte character is not encountered within n bytes, returns -1.
The mbtowc function converts a single multibyte character pointed to by s into the wide-character code that corresponds to that multibyte character.
The code for the null-terminating character is zero. If the multibyte character is valid and pwc is not a NULL pointer, the code is stored in the object pointed to by pwc. At most, n bytes of the array pointed to by s are examined.