#include <stdio.h>
#include <iostream>
#include <locale>
int main()
{
const wchar_t *str = L"\u041F\u043E\u0440\u044F\u0434\u043E\u043A";
std::locale::global(std::locale(""));
std::wcout << str << std::endl;
}
Here's a piece of code that outputs a russian phrase in UTF-32 wchar_t string as:
I believe this is a misconfiguration in either eclipse console or the program, because, for example, other people that just run my code in Eclipse they do see the correct output.
Could someone shed a light on this confusion? What is the correct way to setup all the pieces (OS, gcc, terminal, Eclipse, sources...) to output international symbols that are stored in UTF-32 wchar_t strings?
And as a side note, why should I still care about all this when we have UTF-32 and that should be enough to know what is inside...
It turned out to be that other code changed locale.