Mar 2, 2014 at 1:56pm UTC
On linux this works fine but I'm not sure how to make it work on Windows.
Mar 2, 2014 at 2:08pm UTC
@Peter87 :Might be my IDE? I use CodeBlocks, what are you using?
Last edited on Mar 2, 2014 at 2:09pm UTC
Mar 2, 2014 at 2:13pm UTC
You might want to try this:
http://cppcms.com/files/nowide/html/
To use unicode on windows console in not an easy task. I suggest to either move avay from console of at least don't use cmd.exe for that.
However, you can use WinApi:
1 2 3 4 5 6
#include <windows.h>
//...
const std::wstring result = L"Γεία" ;
const HANDLE stdOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD numWritten = 0;
WriteConsoleW(stdOut, result.c_str(), result.size(), &numWritten, NULL);
Also check this:
https://www.google.com/search?q=Unicode+characters+cout+Windows
Last edited on Mar 2, 2014 at 2:15pm UTC