Content-type: text/html
mbsinit - Determines whether a multibyte-character string is in the initial conversion state
Standard C Library (libc.so, libc.a)
#include <wchar.h>
int mbsinit(
const mbstate_t *ps);
Interfaces documented on this reference page conform to industry standards as follows:
mbsinit(): ISO C
Refer to the standards(5) reference page for more information about industry standards and associated tags.
Points to an mbstate object that contains the current conversion state of a string.
The mbsinit() function determines whether the character sequence being converted is in the initial conversion state; that is, the function determines whether the current character of a character sequence is a multibyte character in the initial shift state as defined by the LC_TYPE category of the current locale.
Use this function along with the restartable conversion functions (mbrlen, mbrtowc, wcrtomb, mbsrtowcs, wcsrtombs) to convert between multibyte-character and wide-character format. Only restartable conversion functions use an mbstate_t parameter. Therefore, results are undefined when restartable and nonrestartable conversion functions operate on the same arrays during a conversion operation.
The mbsinit() function and restartable versions of conversion routines are functional only when used with locales that support shift state encoding. Currently, the Tru64 UNIX product does not provide any locales that use shift state encoding and the mbsinit() function returns a nonzero value only to indicate that *ps is a null pointer.
The mbsinit() function returns a nonzero value if *ps is a null pointer or ps describes an initial conversion state; otherwise, the function returns zero.
Functions: mblen(3), mbstowcs(3), mbtowc(3), wcstombs(3), wctomb(3)
Files: locale(4) delim off