man.bsd.lv manual page server

Manual Page Search Parameters

BTOWC(3) Library Functions Manual BTOWC(3)

btowc, btowc_l, wctob, wctob_lconvert between wide and single-byte characters

library “libc”

#include <wchar.h>

wint_t
btowc(int c);

int
wctob(wint_t c);

#include <wchar.h>
#include <xlocale.h>

wint_t
btowc_l(int c, locale_t loc);

int
wctob_l(wint_t c, locale_t loc);

The () function converts a single-byte character into a corresponding wide character. If the character is EOF or not valid in the initial shift state, btowc() returns WEOF.

The () function converts a wide character into a corresponding single-byte character. If the wide character is WEOF or not able to be represented as a single byte in the initial shift state, wctob() returns EOF.

The _l-suffixed versions take an explicit locale argument, while the non-suffixed versions use the current global or per-thread locale.

mbrtowc(3), multibyte(3), wcrtomb(3)

The btowc() and wctob() functions conform to IEEE Std 1003.1-2001 (“POSIX.1”).

The btowc() and wctob() functions first appeared in FreeBSD 5.0.

February 13, 2012 DragonFly-5.6.1