malloc.3: ffix
[man-pages.git] / man3 / wctob.3
blob1a3837383cec50b5f853f29cd11bd01174e187d9
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
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.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\"   ISO/IEC 9899:1999
15 .\"
16 .TH WCTOB 3 2021-03-22 "GNU" "Linux Programmer's Manual"
17 .SH NAME
18 wctob \- try to represent a wide character as a single byte
19 .SH SYNOPSIS
20 .nf
21 .B #include <wchar.h>
22 .PP
23 .BI "int wctob(wint_t " c );
24 .fi
25 .SH DESCRIPTION
26 The
27 .BR wctob ()
28 function tests whether
29 the multibyte representation of the
30 wide character
31 .IR c ,
32 starting in the initial state, consists of a single
33 byte.
34 If so, it is returned as an
35 .IR "unsigned char" .
36 .PP
37 Never use this function.
38 It cannot help you in writing internationalized
39 programs.
40 Internationalized programs must never distinguish single-byte and
41 multibyte characters.
42 .SH RETURN VALUE
43 The
44 .BR wctob ()
45 function returns the single-byte representation of
46 .IR c ,
47 if it exists, or
48 .B EOF
49 otherwise.
50 .SH ATTRIBUTES
51 For an explanation of the terms used in this section, see
52 .BR attributes (7).
53 .ad l
54 .nh
55 .TS
56 allbox;
57 lbx lb lb
58 l l l.
59 Interface       Attribute       Value
61 .BR wctob ()
62 T}      Thread safety   MT-Safe
63 .TE
64 .hy
65 .ad
66 .sp 1
67 .SH CONFORMING TO
68 POSIX.1-2001, POSIX.1-2008, C99.
69 .SH NOTES
70 The behavior of
71 .BR wctob ()
72 depends on the
73 .B LC_CTYPE
74 category of the
75 current locale.
76 .PP
77 This function should never be used.
78 Internationalized programs must never
79 distinguish single-byte and multibyte characters.
80 Use either
81 .BR wctomb (3)
82 or the thread-safe
83 .BR wcrtomb (3)
84 instead.
85 .SH SEE ALSO
86 .BR btowc (3),
87 .BR wcrtomb (3),
88 .BR wctomb (3)