Debian Codegraph @

upstream/debian-unstable/man3/wctob.3

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