man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

btowc(3C)

Name

btowc - single-byte to wide-character conversion

Synopsis

#include <stdio.h>
#include <wchar.h>

wint_t btowc(int c);

Description

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

The behavior of this function is affected by the LC_CTYPE category of the current locale. See environ(5).

Return Values

The btowc() function returns WEOF if c has the value EOF or if (unsigned char)c does not constitute a valid (one-byte) character in the initial shift state. Otherwise, it returns the wide-character representation of that character.

Errors

No errors are defined.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe with exceptions
Standard

See Also

setlocale(3C), wctob(3C), attributes(5), environ(5), standards(5)

Notes

The btowc() function can be used safely in multithreaded applications, as long as setlocale(3C) is not being called to change the locale.