I have Microsoft Visual Studio 2010 on Windows 7 64bit. (In the project properties, the "Character Set" is set to "Not Installed", however, each setting leads to the same output.)
Source:
using namespace std; char const charTest[] = "árvíztűrő tükörfúrógép ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP\n"; cout << charTest; printf(charTest); if(set_codepage())
* 1: Including windows.h messed up things, so I enable it from a separate cpp.
The compiled binary contains the string as the correct sequence of UTF-8 bytes. If I installed the console in UTF-8 using chcp 65001 and issued type main.cpp , the line will display correctly.
Test (the console is configured to use the Lucida Console font):
D:\dev\user\geometry\Debug>chcp Active code page: 852 D:\dev\user\geometry\Debug>listProcessing.exe ├írv├şzt┼▒r┼Ĺ t├╝k├Ârf├║r├│g├ęp ├üRV├ŹZT┼░R┼É T├ťK├ľRF├ÜR├ôG├ëP ├írv├şzt┼▒r┼Ĺ t├╝k├Ârf├║r├│g├ęp ├üRV├ŹZT┼░R┼É T├ťK├ľRF├ÜR├ôG├ëP DEBUG: set_codepage(): OK rv zt r t k rf r g p RV ZT R T K RF R G P árvíztűrő tükörfúrógép ÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP
What is the explanation for this? Can I somehow ask cout to work as printf ?
ADDITION
Many say that the Windows console does not support UTF-8 characters at all. I am a Hungarian guy in Hungary, I have Windows installed in English (except for the date formats, they are set to Hungarian), and the Cyrillic letters are still displayed correctly with Hungarian letters:

(My default code page is CP852)
c ++ visual-studio utf-8
Notinlist
source share