MBTOWC(3) Linux Programmer's Manual MBTOWC(3)
mbtowc - convert a multibyte sequence to a wide character
int mbtowc(wchar_t *pwc, const char *s, size_t n);
The main case for this function is when s is not NULL and pwc is not NULL. In this case, the mbtowc() function inspects at most n bytes of
the multibyte string starting at s, extracts the next complete multibyte character, converts it to a wide character and stores it at *pwc.
It updates an internal shift state known only to the mbtowc() function. If s does not point to a null byte ('