Node:Non-reentrant Character Conversion, Next:Non-reentrant String Conversion, Up:Non-reentrant Conversion
int mbtowc (wchar_t *restrict result, const char *restrict string, size_t size) | Function |
The mbtowc ("multibyte to wide character") function when called
with non-null string converts the first multibyte character
beginning at string to its corresponding wide character code. It
stores the result in *result .
For a valid multibyte character, For an invalid byte sequence, If the multibyte character code uses shift characters, then
|
int wctomb (char *string, wchar_t wchar) | Function |
The wctomb ("wide character to multibyte") function converts
the wide character code wchar to its corresponding multibyte
character sequence, and stores the result in bytes starting at
string. At most MB_CUR_MAX characters are stored.
Given a valid code, If wchar is an invalid wide character code, If the multibyte character code uses shift characters, then
Calling this function with a wchar argument of zero when
string is not null has the side-effect of reinitializing the
stored shift state as well as storing the multibyte character
|
Similar to mbrlen
there is also a non-reentrant function that
computes the length of a multibyte character. It can be defined in
terms of mbtowc
.
int mblen (const char *string, size_t size) | Function |
The mblen function with a non-null string argument returns
the number of bytes that make up the multibyte character beginning at
string, never examining more than size bytes. (The idea is
to supply for size the number of bytes of data you have in hand.)
The return value of For a valid multibyte character, If the multibyte character code uses shift characters, then The function |