c/string/multibyte/wctomb

@1@ Converts a wide character to multibyte encoding and stores it (including any shift sequences) in the char array whose first element is pointed to by. No more than characters are stored. The conversion is affected by the current locale's LC_CTYPE category. @@ If is the null character, the null byte is written to, preceded by any shift sequences necessary to restore the initial shift state. @@ If is a null pointer, this function resets the global conversion state and determines whether shift sequences are used. @2@ Same as, except that the result is returned in the out-parameter and the following errors are detected at runtime and call the currently installed constraint handler function:
 * is less than the number of bytes that would be written (unless is null)
 * is greater than rsize_max (unless is null)
 * is a null pointer but is not zero

Return value
@1@ If is not a null pointer, returns the number of bytes that are contained in the multibyte representation of  or  if  is not a valid character. @@ If is a null pointer, resets its internal conversion state to represent the initial shift state and returns  if the current multibyte encoding is not state-dependent (does not use shift sequences) or a non-zero value if the current multibyte encoding is state-dependent (uses shift sequences). @2@ zero on success, in which case the multibyte representation of is stored in  and its length is stored in, or, if  is null, the shift sequence status is stored in ). Non-zero on encoding error or runtime constraint violation, in which case  is stored in . The value stored in  never exceeds mb_cur_max