]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/wctob.3
MB_CUR_MAX.3, MB_LEN_MAX.3, btowc.3, fgetwc.3, fgetws.3, fputwc.3, fputws.3, fwide...
[thirdparty/man-pages.git] / man3 / wctob.3
CommitLineData
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.\"
da8a154e 16.TH WCTOB 3 2011-09-22 "GNU" "Linux Programmer's Manual"
fea681da
MK
17.SH NAME
18wctob \- try to represent a wide character as a single byte
19.SH SYNOPSIS
20.nf
21.B #include <wchar.h>
22.sp
23.BI "int wctob(wint_t " c );
24.fi
25.SH DESCRIPTION
60a90ecd
MK
26The
27.BR wctob ()
28function tests whether
ae03dc66 29the multibyte representation of the
fea681da 30wide character \fIc\fP, starting in the initial state, consists of a single
c13182ef 31byte.
d9a10d9d
MK
32If so, it is returned as an
33.IR "unsigned char" .
fea681da 34.PP
c13182ef
MK
35Never use this function.
36It cannot help you in writing internationalized
37programs.
38Internationalized programs must never distinguish single-byte and
ae03dc66 39multibyte characters.
47297adb 40.SH RETURN VALUE
60a90ecd
MK
41The
42.BR wctob ()
43function returns the single-byte representation of \fIc\fP,
f3fef736 44if it exists, of \fBEOF\fP otherwise.
47297adb 45.SH CONFORMING TO
68e1685c 46C99.
fea681da 47.SH NOTES
d9bfdb9c 48The behavior of
60a90ecd 49.BR wctob ()
1274071a
MK
50depends on the
51.B LC_CTYPE
52category of the
fea681da
MK
53current locale.
54.PP
c13182ef
MK
55This function should never be used.
56Internationalized programs must never
ae03dc66 57distinguish single-byte and multibyte characters.
da8a154e
MK
58Use either
59.BR wctomb (3)
60or the thread-safe
61.BR wcrtomb (3)
62instead.
47297adb 63.SH SEE ALSO
11cfb06e 64.BR btowc (3),
da8a154e 65.BR wcrtomb (3),
e37e3282 66.BR wctomb (3)