1btowc(3)                   Library Functions Manual                   btowc(3)
2
3
4

NAME

6       btowc - convert single byte to wide character
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <wchar.h>
13
14       wint_t btowc(int c);
15

DESCRIPTION

17       The btowc() function converts c, interpreted as a multibyte sequence of
18       length 1, starting in the initial shift state, to a wide character  and
19       returns it.  If c is EOF or not a valid multibyte sequence of length 1,
20       the btowc() function returns WEOF.
21

RETURN VALUE

23       The btowc() function returns the wide character converted from the sin‐
24       gle byte c.  If c is EOF or not a valid multibyte sequence of length 1,
25       it returns WEOF.
26

ATTRIBUTES

28       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
29       tributes(7).
30
31       ┌────────────────────────────────────────────┬───────────────┬─────────┐
32Interface                                   Attribute     Value   
33       ├────────────────────────────────────────────┼───────────────┼─────────┤
34btowc()                                     │ Thread safety │ MT-Safe │
35       └────────────────────────────────────────────┴───────────────┴─────────┘
36

STANDARDS

38       C11, POSIX.1-2008.
39

HISTORY

41       C99, POSIX.1-2001.
42

NOTES

44       The behavior of btowc() depends on the LC_CTYPE category of the current
45       locale.
46
47       This function should never be used.  It does  not  work  for  encodings
48       which  have  state,  and  unnecessarily treats single bytes differently
49       from multibyte sequences.  Use either mbtowc(3) or the thread-safe mbr‐
50       towc(3) instead.
51

SEE ALSO

53       mbrtowc(3), mbtowc(3), wctob(3)
54
55
56
57Linux man-pages 6.04              2023-03-30                          btowc(3)
Impressum