Convert a character to a wide-character code
#include <wchar.h>
size_t mbrtowc( wchar_t * pwc,
const char * s,
size_t n,
mbstate_t * ps );
libc
The mbrtowc() function converts single multibyte characters pointed to by s into wide characters pointed to by pwc, to a maximum of n bytes (not characters).
The ps variable is an internal pointer that allows mbrtowc() to be a restartable version of mbtowc(); if ps is NULL, mbrtowc() uses its own internal variable.
This function is affected by LC_TYPE.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
"Multibyte character functions," "Stream I/O functions," and "Wide-character functions" in the summary of functions chapter.