Debian Codegraph @

upstream/debian-trixie/man3/wctob.3

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