std::iswupper(3)
πΈ std::iswupper(3) β C++ Standard Library πΈ
okay bestie, gather round π«Ά this is the manual page for std::iswupper(3) from the C++ Standard Library. It's lowkey a tiny function with main character energy: it checks whether a wide character is an uppercase letter. Let's get into it β¨
β¨ NAME β¨
std::iswupper β std::iswupper. That's the whole name, iconic and to the point π.
β¨ Synopsis β¨
Defined in header <cwctype>
int iswupper( std::wint_t ch );
Checks if the given wide character is an uppercase letter, i.e. one of ABCDEFGHIJKLMNOPQRSTUVWXYZ or any uppercase letter specific to the current locale. No cap. π¦
If the value ofchis neither representable as awchar_tnor equal to the value of the macroWEOF, the behavior is undefined. That's the danger zone, bestie β do not pass weird values and expect cute results π.
πΈ Parameters πΈ
chβ wide character π
π Return value π
Non-zero value if the wide character is an uppercase letter, zero otherwise. That's it. Binary queen. π
π§ Notes π§
ISO 30112 specifies which Unicode characters are included in the POSIX upper category. iykyk π
β¨ Example β¨
okay so run this code, it's giving locale reveal:
// Run this code
#include <clocale>
#include <cwctype>
#include <iostream>
int main()
{
const wchar_t c = L'\u053d'; // Armenian capital letter xeh ('Τ½')
std::cout << std::hex << std::showbase << std::boolalpha;
std::cout << "in the default locale, iswupper("
<< static_cast<std::wint_t>(c) << ") = "
<< static_cast<bool>(std::iswupper(c)) << '\n';
std::setlocale(LC_ALL, "en_US.utf8");
std::cout << "in Unicode locale, iswupper("
<< static_cast<std::wint_t>(c) << ") = "
<< static_cast<bool>(std::iswupper(c)) << '\n';
}
π Output π
in the default locale, iswupper(0x53d) = false
in Unicode locale, iswupper(0x53d) = true
π₯ See also π₯
isupper(std::locale)β checks if a character is classified as uppercase by a locale (function template) πΈisupperβ checks if a character is an uppercase character (function) π- C documentation for
iswupperβ yes, the C version has its own lore π¦
and here's the full ASCII values chart, because we don't skip details in this house π :
ASCII values characters iscntrl isprint isspace
isblank isgraph ispunct isalnum isalpha isupper islower isdigit
isxdigit decimal hexadecimal octal iswcntrl iswprint
iswspace iswblank iswgraph iswpunct iswalnum iswalpha iswupper iswlower
iswdigit iswxdigit 0β8 \x0β\x8 \0β\10 control codes β 0
0 0 0 0 0 0 0 0
0 0 0
(NUL, etc.) 9 \x9 \11
tab (\t) β 0 0 β 0 β 0 0 0 0
0 0 0 0 0
whitespaces 10β13 \xAβ\xD \12β\15
(\n, \v, \f, β 0 0 β 0 0 0 0 0
0 0 0 0 0
\r) 14β31 \xEβ\x1F \16β\37 control
codes β 0 0 0 0 0 0 0 0
0 0 0 0 32 \x20 \40 space
0 β 0 β 0 β 0 0 0 0 0
0 0 0 0 33β47 \x21β\x2F \41β\57
!"#$%&'()*+,-./ 0 β 0 0 0 β 0 β 0 0
0 0 0 0 0 48β57 \x30β\x39 \60β\71
0123456789 0 β 0 0 0 β 0 0 β 0
0 0 0 β 0 β 0 58β64 \x3Aβ\x40 \72β\100
:;<=>?@ 0 β 0 0 0 β 0 β 0 0
0 0 0 0 0 65β70 \x41β\x46 \101β\106
ABCDEF 0 β 0 0 0 β 0 0 β 0
β 0 β 0 0 0 β 0 71β90 \x47β\x5A \107β\132
GHIJKLMNOP 0 β 0 0 0 β 0 0 β 0
β 0 β 0 0 0 0
QRSTUVWXYZ 91β96 \x5Bβ\x60 \133β\140
[\]^_` 0 β 0 0 0 β 0 β 0 0
0 0 0 0 0 97β102 \x61β\x66 \141β\146
abcdef 0 β 0 0 0 β 0 0 β 0
β 0 0 β 0 0 β 0 103β122 \x67β\x7A \147β\172
ghijklmnop 0 β 0 0 0 β 0 0 β 0
β 0 0 β 0 0 0
qrstuvwxyz 123β126 \x7Bβ\x7E \172β\176
{|}~ 0 β 0 0 0 β 0 β 0 0
0 0 0 0 0 127 \x7F \177
backspace β 0 0 0 0 0 0 0
0 0 0 0 0
character (DEL)
source/version: http://cppreference.com Β· date: 2024.06.10 Β· page: std::iswupper(3) β stay iconic, bestie ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms