1BTOWC(3) Linux Programmer's Manual BTOWC(3)
2
3
4
6 btowc - convert single byte to wide character
7
9 #include <wchar.h>
10
11 wint_t btowc(int c);
12
14 The btowc() function converts c, interpreted as a multibyte sequence of
15 length 1, starting in the initial shift state, to a wide character and
16 returns it. If c is EOF or not a valid multibyte sequence of length 1,
17 the btowc() function returns WEOF.
18
20 The btowc() function returns the wide character converted from the sin‐
21 gle byte c. If c is EOF or not a valid multibyte sequence of length 1,
22 it returns WEOF.
23
25 For an explanation of the terms used in this section, see at‐
26 tributes(7).
27
28 ┌────────────────────────────────────────────┬───────────────┬─────────┐
29 │Interface │ Attribute │ Value │
30 ├────────────────────────────────────────────┼───────────────┼─────────┤
31 │btowc() │ Thread safety │ MT-Safe │
32 └────────────────────────────────────────────┴───────────────┴─────────┘
33
35 POSIX.1-2001, POSIX.1-2008, C99.
36
38 The behavior of btowc() depends on the LC_CTYPE category of the current
39 locale.
40
41 This function should never be used. It does not work for encodings
42 which have state, and unnecessarily treats single bytes differently
43 from multibyte sequences. Use either mbtowc(3) or the thread-safe mbr‐
44 towc(3) instead.
45
47 mbrtowc(3), mbtowc(3), wctob(3)
48
50 This page is part of release 5.13 of the Linux man-pages project. A
51 description of the project, information about reporting bugs, and the
52 latest version of this page, can be found at
53 https://www.kernel.org/doc/man-pages/.
54
55
56
57GNU 2021-03-22 BTOWC(3)