fork(1) download
  1. #include <iostream>
  2. #include <locale>
  3. #include <codecvt>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. std::wstring my_wide_string = L"my_sqlite\U00004f60_db.db";
  9. //wcout<< my_wide_string<<endl;
  10. std::wstring_convert<std::codecvt_utf8<wchar_t> > myconv;
  11. string myutf8 = myconv.to_bytes( my_wide_string.c_str() );
  12. cout<< myutf8<<endl;
  13. std::wstring test = myconv.from_bytes(myutf8);
  14. if (my_wide_string != test)
  15. cout << "Problem"<<endl;
  16. else cout << "ok";
  17.  
  18. return 0;
  19. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
my_sqlite你_db.db
ok