Cannot print non-English text to the Console window

拜拜、爱过 提交于 2020-02-05 11:14:50

问题


int main()
{
    wcout << L"Русский текст" << endl;
    wprintf(L"Русский текст\n");
    return 0;
}

This simple program doesn't print anything to the Console window (not even new lines). VC++ 2010 Console Application project. What is wrong?


回答1:


According to links pointed to in this blog you need to change the font of the console and also this line:

_setmode(_fileno(stdout), _O_U16TEXT);


来源:https://stackoverflow.com/questions/20729870/cannot-print-non-english-text-to-the-console-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!