std::iswupper

Header: <cwctype>

Checks if the given wide character is an uppercase letter, i.e. one of ABCDEFGHIJKLMNOPQRSTUVWXYZ or any uppercase letter specific to the current locale.

# Declarations

int iswupper( std::wint_t ch );

# Parameters

# 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';
}

# See also