Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

c16rtomb - convert UTF-16 character to multi-byte character

&pagelevel(4)&pagelevel

Definition  

#include <wchar.h>

size_t c16rtomb(char *s, char16_t c16, mbstate_t *ps);

If s is a null pointer, c16rtomb() corresponds to the call c16rtomb(buf, u'\0', ps) where buf designates an internal buffer.

If s is not a null pointer, c16rtomb() determines how many bytes are required to represent the multibyte character corresponding to UTF-16 character c16. Any Shift sequences are also taken into account. The resulting bytes are written to the array whose first element is pointed to by s.
If c16 is the null character, a null byte is written that can be preceded a Shift sequence that restores the initial conversion state.

The final state corresponds to the “initial conversion” state.

Return val.

(size_t)-1

if c16 does not represent a valid multibyte character, that is, if c16 > 255.. The value of the EILSEQ macro is written to errno. The conversion status is undefined.


the number of bytes written to the array *s.



Otherwise

Notes

Restriction
This version of the C runtime system only supports 1-byte characters as wide character codes. (End)

See also

c32rtomb(), mbrtoc16(), mbrtoc32().