int mbtowc(wchar_t *pwc, const char *s, size_t n);
mbtowc converts a single multi-byte character to a wide character in the current locale.
If s is a null pointer, mbtowc returns a nonzero value if multi-byte character encodings are state-dependent in the current locale, and zero otherwise.
If s is not null and the object that s points to is a wide-character null character, mbtowc returns 0.
If s is not null and the object that points to forms a valid multi-byte character, mbtowc returns the length in bytes of the multi-byte character.
If the object that points to does not form a valid multi-byte character within the first n characters, it returns −1.