MBSRTOWCS(3) BSD Library Functions Manual MBSRTOWCS(3)
mbsrtowcs, mbsnrtowcs -- convert a character string to a wide-character string (restartable)
Standard C Library (libc, -lc)
mbsrtowcs(wchar_t * restrict dst, const char ** restrict src, size_t len, mbstate_t * restrict ps);
mbsnrtowcs(wchar_t * restrict dst, const char ** restrict src, size_t nms, size_t len, mbstate_t * restrict ps);
The mbsrtowcs() function converts a sequence of multibyte characters pointed to indirectly by src into a sequence of corresponding wide char-
acters and stores at most len of them in the wchar_t array pointed to by dst, until it encounters a terminating null character ('