wcrtomb
wcrtomb is a standard C library function that converts a wide character wc into its multibyte representation in the current locale. It writes the resulting bytes to the array pointed to by s and updates the conversion state described by the mbstate_t object pointed to by ps. The conversion uses the LC_CTYPE category of the active locale, and the maximum possible length of a multibyte sequence is MB_CUR_MAX.
Parameters: s is a pointer to a buffer where the multibyte sequence is stored; wc is the
Return value: wcrtomb returns the number of bytes written to s (the length of the multibyte sequence).
Usage notes: If s is NULL, the function does not write any bytes but may still update
Relation to other functions: wcrtomb is the counterpart to mbrtowc, providing the reverse operation (wide character