std::iswlower
From cppreference.com
| Defined in header <cwctype>
|
||
int iswlower( std::wint_t ch );
|
||
Checks if the given wide character is a lowercase letter, i.e. one of abcdefghijklmnopqrstuvwxyz or any lowercase letter specific to the current locale.
If the value of ch is neither representable as a wchar_t nor equal to the value of the macro WEOF, the behavior is undefined.
Parameters
| ch | - | wide character |
Return value
Non-zero value if the wide character is a lowercase letter, zero otherwise.
Notes
ISO 30112 specifies which Unicode characters are include in POSIX lower category.
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
| checks if a character is classified as lowercase by a locale (function template) | |
| checks if a character is lowercase (function) | |
C documentation for iswlower
| |
