c/string/multibyte/mbtowc

Converts a multibyte character whose first byte is pointed to by to a wide character, written to  if  is not null.

If is a null pointer, resets the global conversion state and determines whether shift sequences are used.

Return value
If is not a null pointer, returns the number of bytes that are contained in the multibyte character or  if the first bytes pointed to by  do not form a valid multibyte character or  if  is pointing at the null character.

If is a null pointer, resets its internal conversion state to represent the initial shift state and returns  if the current multibyte encoding is not state-dependent (does not use shift sequences) or a non-zero value if the current multibyte encoding is state-dependent (uses shift sequences).