mbrtowc converts one multibyte character from s into the wide character pointed to by pwc, using at most len bytes and preserving conversion state through mbstate_t. section 14.3
Interface
size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t len, mbstate_t* restrict ps); section 14.3
Interpret the result together with the scan limit:
- Use len as the maximum number of bytes examined for one multibyte character. section 14.3
- Treat mbincomplete as an indication that len was too small for the character. section 14.3
- Treat mbinvalid as a conversion error; invalid encoding can also set errno to EILSEQ. section 14.3
- Pass conversion state when processing characters across calls; a wrapper can start with MB_LEN_MAX and enlarge len after mbincomplete. section 14.3
size_t mbrtowc(wchar_t*restrict pwc,
const char*restrict s, size_t len,
mbstate_t* restrict ps);
Browse the exact C declaration for the conversion function. section 14.3

