fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. #include <locale>
  4.  
  5. void func(const std::wstring& str)
  6. {
  7. for(size_t n = 0; n < str.size(); ++n)
  8. std::wcout << str[n];
  9. std::wcout << '\n';
  10. }
  11.  
  12. int main()
  13. {
  14. std::locale::global(std::locale(""));
  15. std::wcout.imbue(std::locale());
  16. func(L"空手道");
  17. }
  18.  
Success #stdin #stdout 0s 4528KB
stdin
Standard input is empty
stdout
空手道