std::iswlower(3)
okay so bestie, weβre opening up std::iswlower(3) from the C++ Standard Libary (yes, thatβs the headerβs spelling β Iβm just the messenger π). this page is literally a vibe check for wide lowercase letters, and it is lowkey iconic. letβs get into it.
π NAME π
std::iswlower β and the source NAME line is literally std::iswlower - std::iswlower, which is giving βI said what I saidβ energy. it checks wide characters for lowercase-ness.
πΈ Synopsis πΈ
defined in header <cwctype>
int iswlower( std::wint_t ch );
this function checks if the given wide character is a lowercase letter, aka one of abcdefghijklmnopqrstuvwxyz or any lowercase letter specific to the current locale. periodt.
β οΈ undefined behavior alert: if the value ofchis neither representable as awchar_tnor equal to the value of the macroWEOF, the behavior is undefined. no cap, donβt test it.
π Parameters π
chβ a wide character. thatβs the whole parameter, bestie.
β¨ Return value β¨
- Non-zero value if the wide character is a lowercase letter. π
- zero otherwise. thatβs it, thatβs the return.
π¦ Notes π¦
ISO 30112 specifies which Unicode characters are included in the POSIX lower category. so if youβre wondering why some Unicode letters get the lowercase crown π, thatβs the standard doing its thing.
π Example π
// Run this code
#include <clocale>
#include <cwctype>
#include <iostream>
int main()
{
wchar_t c = L'\u0444'; // Cyrillic small letter ef ('Ρ')
std::cout << std::hex << std::showbase << std::boolalpha
<< "in the default locale, iswlower("
<< static_cast<std::wint_t>(c) << ") = "
<< static_cast<bool>(std::iswlower(c)) << '\n';
std::setlocale(LC_ALL, "en_US.utf8");
std::cout << "in Unicode locale, iswlower("
<< static_cast<std::wint_t>(c) << ") = "
<< static_cast<bool>(std::iswlower(c)) << '\n';
}
π Output π
in the default locale, iswlower(0x444) = false
in Unicode locale, iswlower(0x444) = true
π See also π
islower(std::locale)β checks if a character is classified as lowercase by a locale (function template).islowerβ checks if a character is lowercase (function).- C documentation for
iswlowerβ yes, the C version also exists, iykyk.
also the original page has this giant ASCII values/classification chart at the bottom, and I am not skipping it. hereβs the whole thing, preserved in its original wrapped, chaotic layout β the formatting is giving βmanpage extraction went feralβ π:
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)
made with π by http://cppreference.com Β· page date 2024.06.10 Β· manual std::iswlower(3) β slay, you made it to the end. π«Ά
π¦ 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