wcsrtombs
wcsrtombs is a function in the C standard library that converts a sequence of wide characters to a multibyte character string according to a specified locale. It is the stateful counterpart to wcstombs, allowing incremental conversion across calls by maintaining conversion state in an mbstate_t object. The function uses the current locale or a provided locale to determine how wide characters map to multibyte sequences.
size_t wcsrtombs(char *restrict s, const wchar_t **restrict pwcs, size_t len, mbstate_t *restrict ps, locale_t locale);
s points to the destination buffer where the resulting multibyte characters are stored. len specifies the maximum
The function converts wide characters from the source into their multibyte representations, writing at most len
On success, wcsrtombs returns the number of bytes placed in s, not counting the terminating NUL. If