btowc() — Convert single-byte character to wide-character

Standards

Standards / Extensions C or C++ Dependencies

ISO C
C99
Single UNIX Specification, Version 3

both z/OS V1R2

Format

#include <wchar.h>

wint_t btowc(int c);

General description

The btowc() function determines whether c constitutes a valid (one-byte) character in the initial shift state.

The behavior of this wide-character function is affected by the LC_CTYPE category of the current locale. If you change the category, undefined results can occur.

Returned value

If successful, btowc() returns the wide-character representation of the character c.

If c has the value EOF or if (unsigned char)c does not constitute a valid (one-byte) character in the initial shift state, btowc() returns WEOF.

There are no documented errno values.

Related information