SysTutorials

Man Pages › Section 3

mbtowc(3)

NAME

mbtowc – convert a multibyte sequence to a wide character

SYNOPSIS


#include <stdlib.h>
int mbtowc(wchar_t *pwc, const char *s, size_t n);

DESCRIPTION

The main case for this function is when s is not NULL and pwc is not NULL. In this case, the mbtowc() function inspects at most n bytes of the multibyte string starting at s, extracts the next complete multibyte character, converts it to a wide character and stores it at *pwc. It updates an internal shift state known only to the mbtowc() function. If s does not point to a null byte (‘