]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man/man3/btowc.3
man/, share/mk/: Move man*/ to man/
[thirdparty/man-pages.git] / man / man3 / btowc.3
CommitLineData
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
14btowc \- convert single byte to wide character
b813014f
AC
15.SH LIBRARY
16Standard C library
17.RI ( libc ", " \-lc )
fea681da
MK
18.SH SYNOPSIS
19.nf
20.B #include <wchar.h>
c6d039a3 21.P
fea681da
MK
22.BI "wint_t btowc(int " c );
23.fi
24.SH DESCRIPTION
60a90ecd
MK
25The
26.BR btowc ()
27function converts \fIc\fP,
c13182ef 28interpreted as a multibyte sequence
fea681da 29of length 1, starting in the initial shift state, to a wide character and
c13182ef 30returns it.
cab87712
MK
31If \fIc\fP is
32.B EOF
33or not a valid multibyte sequence of length 1,
60a90ecd
MK
34the
35.BR btowc ()
cab87712
MK
36function returns
37.BR WEOF .
47297adb 38.SH RETURN VALUE
60a90ecd
MK
39The
40.BR btowc ()
41function returns the wide character
c13182ef 42converted from the single byte \fIc\fP.
cab87712
MK
43If \fIc\fP is
44.B EOF
45or not a valid multibyte sequence of length 1,
46it returns
47.BR WEOF .
8b35b7c8
MS
48.SH ATTRIBUTES
49For an explanation of the terms used in this section, see
50.BR attributes (7).
51.TS
52allbox;
c466875e 53lbx lb lb
8b35b7c8
MS
54l l l.
55Interface Attribute Value
56T{
9e54434e
BR
57.na
58.nh
8b35b7c8
MS
59.BR btowc ()
60T} Thread safety MT-Safe
61.TE
3113c7f3 62.SH STANDARDS
4131356c
AC
63C11, POSIX.1-2008.
64.SH HISTORY
65C99, POSIX.1-2001.
fea681da 66.SH NOTES
d9bfdb9c 67The behavior of
60a90ecd 68.BR btowc ()
1274071a
MK
69depends on the
70.B LC_CTYPE
71category of the
fea681da 72current locale.
c6d039a3 73.P
c13182ef
MK
74This function should never be used.
75It does not work for encodings which have
fea681da 76state, and unnecessarily treats single bytes differently from multibyte
c13182ef 77sequences.
da8a154e
MK
78Use either
79.BR mbtowc (3)
80or the thread-safe
81.BR mbrtowc (3)
60a90ecd 82instead.
47297adb 83.SH SEE ALSO
da8a154e 84.BR mbrtowc (3),
2bfa8272 85.BR mbtowc (3),
3e5c319e 86.BR wctob (3)