无法将非英文文本打印到控制台窗口 [英] Cannot print non-English text to the Console window

查看:152
本文介绍了无法将非英文文本打印到控制台窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

这个简单的程序不会打印任何东西到控制台窗口线)。 VC ++ 2010控制台应用程序项目。有什么问题?

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

推荐答案

根据此博客,您需要更改控制台的字体,并且还有以下行:

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);

这篇关于无法将非英文文本打印到控制台窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆