If s is not a null pointer, inspects at most n bytes of the multibyte character string, beginning with the byte pointed to by s to determine the number of bytes necessary to complete the next multibyte character (including any shift sequences). If the function determines that the next multibyte character in s is complete and valid, converts it to the corresponding wide character and stores it in *pwc (if pwc is not null).

If s is a null pointer, the values of n and pwc are ignored and call is equivalent to std::mbrtowc(NULL, "", 1, ps).

If the wide character produced is the null character, the conversion state stored in *ps is the initial shift state.