Skip to content

Instantly share code, notes, and snippets.

@johnhmj
Created February 17, 2011 08:14
Show Gist options
  • Save johnhmj/831288 to your computer and use it in GitHub Desktop.
Save johnhmj/831288 to your computer and use it in GitHub Desktop.
在DOS模式下顯示日文(先變更控制台語言設定)
#include<iostream>
#include<cstdlib>
#include<locale>
using namespace std;
int main(int argc, char** argv)
{
wchar_t* wcsZHTW = L"早安你好";
_wsetlocale(LC_ALL, L"cht");
wcout << wcsZHTW << endl;
//
// 以下可能要先變更系統控制台的語言設定「日文」
//wchar_t* wcsJPN = L"お早うございます";
//_wsetlocale(LC_ALL, L"japanese");
//wcout << wcsJPN << endl;
system("PAUSE");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment