fork(3) download
  1. #include <iostream>
  2. #include <clocale>
  3. #include <cwctype>
  4. #include <cstdlib>
  5.  
  6. int main()
  7. {
  8. std::setlocale(LC_ALL, "en_US.utf8");
  9.  
  10. char utf8[] = {'\xc3', '\x81'};
  11. wchar_t big;
  12. std::mbtowc(&big, utf8, sizeof utf8);
  13. // or just skip the whole utf8 conversion
  14. // wchar_t big = L'Á';
  15.  
  16. wchar_t small = std::towlower(big);
  17.  
  18. std::wcout << "Big: " << big << '\n'
  19. << "Small: " << small << '\n';
  20. }
  21.  
Success #stdin #stdout 0.02s 4908KB
stdin
Standard input is empty
stdout
Big: Á
Small: á