Multibyte/Wide-Character Conversion Functions : Wide Character Functions « Wide Character String « C Tutorial






They use the header .

Wide-Character/Multibyte Conversion Functions

FunctionDescription
win_t btowc(int ch)Converts ch into its wide-character equivalent and returns the result. Returns WEOF on error or if ch is not a one-byte, multibyte character.
size_t mbrlen(const char *str, size_t num,mbstate_t *state)Restartable version of mblen() as described by state. Returns a positive value that indicates the length of the next multibyte character. Zero is returned if the next character is null. A negative value is returned if an error occurs.
size_t mbrtowc(wchar_t *out,const char *in,size_t num,mbstate_t *state)Restartable version of mbtowc() as described by state. Returns a positive value that indicates the length of the next multibyte character. Zero is returned if the next character is null. A value of -1 is returned if an error occurs and the macro EILSEQ is assigned to errno. If the conversion is incomplete, -2 is returned.
int mbsinit(const mbstate_t *state)Returns true if state represents an initial conversion state.
size_t mbsrtowcs(wchar_t *out,const char **in,size_t num, mbstate_t state)Restartable version of mbstowcs() as described by state. Also, mbsrtowcs() differs from mbstowcs() in that in is an indirect pointer to the source array. If an error occurs, the macro EILSEQ is assigned to errno.
size_t wcrtomb(char *out, wchar_t ch, mbstate_t *state)Restartable version of wctomb() as described by state. If an error occurs, the macro EILSEQ is assigned to errno.
size_t wcsrtombs(char *out, const wchar_t **in, size_t num, mbstate_t *state)Restartable version of wcstombs() as described by state. Also, wcsrtombs() differs from wcstombs() in that in is an indirect pointer to the source array. If an error occurs, the macro EILSEQ is assigned to errno.
int wctob(wint_t ch)Converts ch into its one-byte, multibyte equivalent. It returns EOF on failure.


(C: The Complete Reference, Fourth Edition by Herbert Schildt McGraw-Hill/Osborne 2000 ISBN-10: 0072121246, ISBN-13: 978-0072121247)









16.1.Wide Character Functions
16.1.1.Wide-Character Functions
16.1.2.Wide-Character I/O Functions
16.1.3.Wide-Character String Functions
16.1.4.Wide-Character String Conversion Functions
16.1.5.Wide-Character Array Functions
16.1.6.Multibyte/Wide-Character Conversion Functions
16.1.7.An open-ended means of classifying characters.