fork download
  1. #include <cctype>
  2. #include <clocale>
  3. #include <iostream>
  4.  
  5. int main()
  6. {
  7. unsigned char c = 'Đ'; // the character Ž in ISO-8859-15
  8. // but ´ (acute accent) in ISO-8859-1
  9.  
  10. std::setlocale(LC_ALL, "en_US.iso88591");
  11. std::cout << std::hex << std::showbase;
  12. std::cout << "in iso8859-1, tolower('Đ') gives " << std::tolower(c) << '\n';
  13. std::setlocale(LC_ALL, "en_US.iso88592");
  14. std::cout << "in iso8859-2, tolower('Đ') gives " << std::tolower(c) << '\n';
  15. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
in iso8859-1, tolower('Đ') gives 0x90
in iso8859-2, tolower('Đ') gives 0x90