问题描述
我正试图在Visual Studio 2008中输出俄语单词。
I'm trying to output Russian words in Visual Studio 2008. I wrote:
#include <iostream>
#include <locale.h>
using namespace std;
void main()
{
setlocale(LC_ALL,"rus");
cout << "Я хочу видеть это по-русски!";
}
当我按下 + 在Visual Studio中保存文件,我收到以下提示:
When I pressed + to save the file in Visual Studio, I received the following prompt:
我选择了使用其他编码保存选项,然后选择了西里尔字母(Windows)-代码页1251。但是,当我运行程序时,控制台输出如下所示:
I chose the option "Save with other Encoding" and selected "Cyrillic (Windows) - Codepage 1251." However, when I run my program, the console output appears as follows:
???????? ??? ????
推荐答案
问题是您没有使用Unicode字符set(wstring,wcout as @
BìnhNguyên已经提到过)。解决此问题的方法有两种:
1.使用Unicode字符集。
2.转到控制面板->区域和语言->管理标签->非Unicode程序的语言->更改系统区域设置...->选择俄罗斯。
The problem is that you aren't using Unicode characters set (wstring, wcout as @Bình Nguyên have already mentioned). There are two ways to solve this problem:
1. Use unicode characters set.
2. Go to Control Panel -> Region and Language -> Administrative Tab -> Language for non-Unicode programs -> Change system locale... -> choose Russia.
这篇关于我在Visual Studio 2008中看不到俄语字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!