]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/btowc.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / 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>
68e4db0a 21.PP
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
c466875e 62.sp 1
3113c7f3 63.SH STANDARDS
4131356c
AC
64C11, POSIX.1-2008.
65.SH HISTORY
66C99, POSIX.1-2001.
fea681da 67.SH NOTES
d9bfdb9c 68The behavior of
60a90ecd 69.BR btowc ()
1274071a
MK
70depends on the
71.B LC_CTYPE
72category of the
fea681da
MK
73current locale.
74.PP
c13182ef
MK
75This function should never be used.
76It does not work for encodings which have
fea681da 77state, and unnecessarily treats single bytes differently from multibyte
c13182ef 78sequences.
da8a154e
MK
79Use either
80.BR mbtowc (3)
81or the thread-safe
82.BR mbrtowc (3)
60a90ecd 83instead.
47297adb 84.SH SEE ALSO
da8a154e 85.BR mbrtowc (3),
2bfa8272 86.BR mbtowc (3),
3e5c319e 87.BR wctob (3)