btowc.3c (2010 09)
b
btowc(3C) btowc(3C)
NAME
btowc(), wctob() - conversion between single-byte and wide character
SYNOPSIS
#include <stdio.h>
#include <wchar.h>
wint_t btowc(int c );
int wctob(wint_t c );
DESCRIPTION
btowc() The btowc() function determines whether c constitutes a valid (one-byte) character in
the initial shift state.
wctob() The wctob() function determines whether c corresponds to a member of the extended
character set whose character representation is a single byte when in the initial shift
state.
APPLICATION USAGE
The prototypes of these functions are available to applications if they are:
a.
c99 conformant.
b. Compiled with the
-D_XOPEN_SOURCE
macro with a value >=500.
c. Compiled with the
-D_POSIX_C_SOURCE
macro with a value >= 200112.
EXTERNAL INFLUENCES
Environment Variables
The behavior of these functions is affected by the
LC_CTYPE category.
RETURN VALUE
The
btowc() function returns WEOF if c has the value EOF or if c as an unsigned character does not con-
stitute a valid (one-byte) character in the initial shift state. Otherwise, it returns the wide character
representation of that character.
The
wctob() function returns EOF if c does not correspond to a character with length one in the initial
shift state. Otherwise, it returns the single-byte representation of that character.
ERRORS
No errors are defined.
AUTHOR
btowc() was developed by HP and Mitsubishi Electric Corp.
SEE ALSO
thread_safety(5).
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1