I do not see the Russian alphabet in Visual Studio 2008

I am 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 << "    -!"; } 

When I pressed Ctrl + S to save the file in Visual Studio, I received the following prompt:

Some Unicode characters in this file cannot be stored in the current code page. Want to save it in Unicode?

I selected the option "Save with a different encoding" and selected "Cyrillic (Windows) - Codepage 1251". However, when I run my program, the console output looks like this:

 ???????? ??? ???? 
+4
source share
1 answer

The problem is that you are not using the Unicode character set (wstring, wcout as @ Bình Nguyn already mentioned). There are two ways to solve this problem:

1. Use Unicode characters.
2. Go to Control Panel → Region and Language → Administrative tab → Language for programs other than Unicode → Change system language ... → select Russia.

+2
source

All Articles