std::iswupper - cppreference.com
Namespaces
Variants

std::iswupper

From cppreference.com
 
 
 
 
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.

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 an uppercase letter, zero otherwise.

Notes

ISO 30112 specifies which Unicode characters are include in POSIX upper category.

Example

#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

checks if a character is classified as uppercase by a locale
(function template) [edit]
checks if a character is an uppercase character
(function) [edit]
C documentation for iswupper