Debian Codegraph @

upstream/debian-unstable/man3/towupper.3

raw
1 '\" t
2 .\" Copyright 2014, Michael Kerrisk <[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 towupper 3 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 towupper, towupper_l \- convert a wide character to uppercase
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ,\~ \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <wctype.h>
16 .P
17 .BI "wint_t towupper(wint_t " wc );
18 .BI "wint_t towupper_l(wint_t " wc ", locale_t " locale );
19 .fi
20 .P
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .P
26 .BR towupper_l ():
27 .nf
28 Since glibc 2.10:
29 _XOPEN_SOURCE >= 700
30 Before glibc 2.10:
31 _GNU_SOURCE
32 .fi
33 .SH DESCRIPTION
34 The
35 .BR towupper ()
36 function is the wide-character equivalent of the
37 .BR toupper (3)
38 function.
39 If
40 .I wc
41 is a lowercase wide character,
42 and there exists an uppercase equivalent in the current locale,
43 it returns the uppercase equivalent of
44 .IR wc .
45 In all other cases,
46 .I wc
47 is returned unchanged.
48 .P
49 The
50 .BR towupper_l ()
51 function performs the same task,
52 but performs the conversion based on the character type information in
53 the locale specified by
54 .IR locale .
55 The behavior of
56 .BR towupper_l ()
57 is undefined if
58 .I locale
59 is the special locale object
60 .B LC_GLOBAL_LOCALE
61 (see
62 .BR duplocale (3))
63 or is not a valid locale object handle.
64 .P
65 The argument
66 .I wc
67 must be representable as a
68 .I wchar_t
69 and be a valid character in the locale or be the value
70 .BR WEOF .
71 .SH RETURN VALUE
72 If
73 .I wc
74 was convertible to uppercase,
75 .BR towupper ()
76 returns its uppercase equivalent;
77 otherwise it returns
78 .IR wc .
79 .SH ATTRIBUTES
80 For an explanation of the terms used in this section, see
81 .BR attributes (7).
82 .TS
83 allbox;
84 lbx lb lb
85 l l l.
86 Interface Attribute Value
87 T{
88 .na
89 .nh
90 .BR towupper ()
91 T} Thread safety MT-Safe locale
92 T{
93 .na
94 .nh
95 .BR towupper_l ()
96 T} Thread safety MT-Safe
97 .TE
98 .SH STANDARDS
99 .TP
100 .BR towupper ()
101 C11, POSIX.1-2008 (XSI).
102 .TP
103 .BR towupper_l ()
104 POSIX.1-2008.
105 .SH HISTORY
106 .TP
107 .BR towupper ()
108 C99, POSIX.1-2001 (XSI).
109 Obsolete in POSIX.1-2008 (XSI).
110 .TP
111 .BR towupper_l ()
112 POSIX.1-2008.
113 glibc 2.3.
114 .SH NOTES
115 The behavior of these functions depends on the
116 .B LC_CTYPE
117 category of the locale.
118 .P
119 These functions are not very appropriate for dealing with Unicode characters,
120 because Unicode knows about three cases: upper, lower, and title case.
121 .SH SEE ALSO
122 .BR iswupper (3),
123 .BR towctrans (3),
124 .BR towlower (3),
125 .BR locale (7)