Unfortunately, the C ++ standard library does not have sufficient support to change the case of all possible non-English characters (compared to those characters that have case variants in general). This limitation is due to the fact that the C ++ standard assumes that one character and its case variants occupy exactly one char object (or wchar_t object for wide characters) and for non-English characters that are not guaranteed to be true (also depending on how characters are encoded).
If your environment uses single-byte encoding for the corresponding characters, this may give you what you want:
std::cout << std::tolower('Ü', locale());
With wide characters, you are probably more lucky:
std::wcout << std::tolower(L'Ü', locale());
but even this will not give the correct result for toupper(L'ß') , which will be the two-character sequence L"SS" ).
If you need support for all characters, check out the ICU library , in particular the case mappings section.
source share