cygwin64でMessageBoxの文字化け回避
#include <windows.h> // fileencoding=utf-8 // fileformat=utf-8 int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // 成功 //LPCWSTR s = L"あいうえお"; // 成功 //WCHAR s[] = L"あいうえお"; //WCHAR const *s = L"あいうえお"; //const WCHAR *s = L"あいうえお"; // 成功 wchar_t s[] = L"あいうえお"; //wchar_t const *s = L"あいうえお"; //const wchar_t *s = L"あいうえお"; MessageBox(NULL, s, s, MB_OK); return 0; } // x86_64-w64-mingw32-g++ (GCC) 4.8.2 // CYGWIN_NT-6.1 non-pc 1.7.28(0.271/5/3) 2014-02-09 21:06 x86_64 Cygwin // compile option // PATH=$PATH:/usr/x86_64-w64-mingw32/sys-root/mingw/bin // x86_64-w64-mingw32-g++ -DUNICODE -std=c++11 -Wall test.cpp