]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/towupper.3
towupper.3: Largely rewrite description of towupper() to be simpler and clearer
[thirdparty/man-pages.git] / man3 / towupper.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\" and Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\" %%%LICENSE_END
10 .\"
11 .\" References consulted:
12 .\" GNU glibc-2 source code and manual
13 .\" Dinkumware C library reference http://www.dinkumware.com/
14 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
15 .\" ISO/IEC 9899:1999
16 .\"
17 .TH TOWUPPER 3 2014-01-22 "GNU" "Linux Programmer's Manual"
18 .SH NAME
19 towupper \- convert a wide character to uppercase
20 .SH SYNOPSIS
21 .nf
22 .B #include <wctype.h>
23 .sp
24 .BI "wint_t towupper(wint_t " wc );
25 .fi
26 .SH DESCRIPTION
27 The
28 .BR towupper ()
29 function is the wide-character equivalent of the
30 .BR toupper (3)
31 function.
32 If
33 .I wc
34 is a lowercase wide character,
35 and there exists an uppercase equivalent in the current locale,
36 it returns the uppercase equivalent of
37 .IR wc .
38 In all other cases,
39 .I wc
40 is returned unchanged.
41
42 The argument
43 .I wc
44 must be representable as a
45 .IR wchar_t
46 and be a valid character in the locale or the value
47 .BR WEOF .
48 .SH RETURN VALUE
49 If
50 .I wc
51 was convertible to uppercase,
52 .BR towupper ()
53 returns its uppercase equivalent;
54 otherwise it returns
55 .IR wc .
56 .SH ATTRIBUTES
57 .SS Multithreading (see pthreads(7))
58 The
59 .BR towupper ()
60 function is thread-safe with exceptions.
61 It can be safely used in multithreaded applications, as long as
62 .BR setlocale (3)
63 is not called to change the locale during its execution.
64 .SH CONFORMING TO
65 C99.
66 .SH NOTES
67 The behavior of
68 .BR towupper ()
69 depends on the
70 .B LC_CTYPE
71 category of the
72 current locale.
73 .PP
74 This function is not very appropriate for dealing with Unicode characters,
75 because Unicode knows about three cases: upper, lower and title case.
76 .SH SEE ALSO
77 .BR iswupper (3),
78 .BR towctrans (3),
79 .BR towlower (3)