]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
89e3ffe9 | 3 | .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA) |
fea681da MK |
4 | .\" This is free documentation; you can redistribute it and/or |
5 | .\" modify it under the terms of the GNU General Public License as | |
6 | .\" published by the Free Software Foundation; either version 2 of | |
7 | .\" the License, or (at your option) any later version. | |
fe382ebf | 8 | .\" %%%LICENSE_END |
fea681da MK |
9 | .\" |
10 | .\" References consulted: | |
11 | .\" GNU glibc-2 source code and manual | |
12 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 13 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da MK |
14 | .\" ISO/IEC 9899:1999 |
15 | .\" | |
460495ca | 16 | .TH BTOWC 3 2015-08-08 "GNU" "Linux Programmer's Manual" |
fea681da MK |
17 | .SH NAME |
18 | btowc \- convert single byte to wide character | |
19 | .SH SYNOPSIS | |
20 | .nf | |
21 | .B #include <wchar.h> | |
68e4db0a | 22 | .PP |
fea681da MK |
23 | .BI "wint_t btowc(int " c ); |
24 | .fi | |
25 | .SH DESCRIPTION | |
60a90ecd MK |
26 | The |
27 | .BR btowc () | |
28 | function converts \fIc\fP, | |
c13182ef | 29 | interpreted as a multibyte sequence |
fea681da | 30 | of length 1, starting in the initial shift state, to a wide character and |
c13182ef | 31 | returns it. |
cab87712 MK |
32 | If \fIc\fP is |
33 | .B EOF | |
34 | or not a valid multibyte sequence of length 1, | |
60a90ecd MK |
35 | the |
36 | .BR btowc () | |
cab87712 MK |
37 | function returns |
38 | .BR WEOF . | |
47297adb | 39 | .SH RETURN VALUE |
60a90ecd MK |
40 | The |
41 | .BR btowc () | |
42 | function returns the wide character | |
c13182ef | 43 | converted from the single byte \fIc\fP. |
cab87712 MK |
44 | If \fIc\fP is |
45 | .B EOF | |
46 | or not a valid multibyte sequence of length 1, | |
47 | it returns | |
48 | .BR WEOF . | |
8b35b7c8 MS |
49 | .SH ATTRIBUTES |
50 | For an explanation of the terms used in this section, see | |
51 | .BR attributes (7). | |
52 | .TS | |
53 | allbox; | |
54 | lb lb lb | |
55 | l l l. | |
56 | Interface Attribute Value | |
57 | T{ | |
58 | .BR btowc () | |
59 | T} Thread safety MT-Safe | |
60 | .TE | |
47297adb | 61 | .SH CONFORMING TO |
7d746fdb | 62 | POSIX.1-2001, POSIX.1-2008, C99. |
fea681da | 63 | .SH NOTES |
d9bfdb9c | 64 | The behavior of |
60a90ecd | 65 | .BR btowc () |
1274071a MK |
66 | depends on the |
67 | .B LC_CTYPE | |
68 | category of the | |
fea681da MK |
69 | current locale. |
70 | .PP | |
c13182ef MK |
71 | This function should never be used. |
72 | It does not work for encodings which have | |
fea681da | 73 | state, and unnecessarily treats single bytes differently from multibyte |
c13182ef | 74 | sequences. |
da8a154e MK |
75 | Use either |
76 | .BR mbtowc (3) | |
77 | or the thread-safe | |
78 | .BR mbrtowc (3) | |
60a90ecd | 79 | instead. |
47297adb | 80 | .SH SEE ALSO |
da8a154e | 81 | .BR mbrtowc (3), |
2bfa8272 | 82 | .BR mbtowc (3), |
3e5c319e | 83 | .BR wctob (3) |