]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
3 | .\" | |
e4a74ca8 | 4 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
5 | .\" |
6 | .\" References consulted: | |
7 | .\" GNU glibc-2 source code and manual | |
8 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 9 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da MK |
10 | .\" ISO/IEC 9899:1999 |
11 | .\" | |
4c1c5274 | 12 | .TH btowc 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
13 | .SH NAME |
14 | btowc \- convert single byte to wide character | |
b813014f AC |
15 | .SH LIBRARY |
16 | Standard C library | |
17 | .RI ( libc ", " \-lc ) | |
fea681da MK |
18 | .SH SYNOPSIS |
19 | .nf | |
20 | .B #include <wchar.h> | |
68e4db0a | 21 | .PP |
fea681da MK |
22 | .BI "wint_t btowc(int " c ); |
23 | .fi | |
24 | .SH DESCRIPTION | |
60a90ecd MK |
25 | The |
26 | .BR btowc () | |
27 | function converts \fIc\fP, | |
c13182ef | 28 | interpreted as a multibyte sequence |
fea681da | 29 | of length 1, starting in the initial shift state, to a wide character and |
c13182ef | 30 | returns it. |
cab87712 MK |
31 | If \fIc\fP is |
32 | .B EOF | |
33 | or not a valid multibyte sequence of length 1, | |
60a90ecd MK |
34 | the |
35 | .BR btowc () | |
cab87712 MK |
36 | function returns |
37 | .BR WEOF . | |
47297adb | 38 | .SH RETURN VALUE |
60a90ecd MK |
39 | The |
40 | .BR btowc () | |
41 | function returns the wide character | |
c13182ef | 42 | converted from the single byte \fIc\fP. |
cab87712 MK |
43 | If \fIc\fP is |
44 | .B EOF | |
45 | or not a valid multibyte sequence of length 1, | |
46 | it returns | |
47 | .BR WEOF . | |
8b35b7c8 MS |
48 | .SH ATTRIBUTES |
49 | For an explanation of the terms used in this section, see | |
50 | .BR attributes (7). | |
51 | .TS | |
52 | allbox; | |
c466875e | 53 | lbx lb lb |
8b35b7c8 MS |
54 | l l l. |
55 | Interface Attribute Value | |
56 | T{ | |
9e54434e BR |
57 | .na |
58 | .nh | |
8b35b7c8 MS |
59 | .BR btowc () |
60 | T} Thread safety MT-Safe | |
61 | .TE | |
c466875e | 62 | .sp 1 |
3113c7f3 | 63 | .SH STANDARDS |
4131356c AC |
64 | C11, POSIX.1-2008. |
65 | .SH HISTORY | |
66 | C99, POSIX.1-2001. | |
fea681da | 67 | .SH NOTES |
d9bfdb9c | 68 | The behavior of |
60a90ecd | 69 | .BR btowc () |
1274071a MK |
70 | depends on the |
71 | .B LC_CTYPE | |
72 | category of the | |
fea681da MK |
73 | current locale. |
74 | .PP | |
c13182ef MK |
75 | This function should never be used. |
76 | It does not work for encodings which have | |
fea681da | 77 | state, and unnecessarily treats single bytes differently from multibyte |
c13182ef | 78 | sequences. |
da8a154e MK |
79 | Use either |
80 | .BR mbtowc (3) | |
81 | or the thread-safe | |
82 | .BR mbrtowc (3) | |
60a90ecd | 83 | instead. |
47297adb | 84 | .SH SEE ALSO |
da8a154e | 85 | .BR mbrtowc (3), |
2bfa8272 | 86 | .BR mbtowc (3), |
3e5c319e | 87 | .BR wctob (3) |