In the project, the source files in UTF8 encoding cannot be changed, I need this particular encoding. When I try to output Russian letters to the console, I get this:
Code:
#include <iostream> using namespace std; int main(int argc, char *argv[]) { setlocale(LC_ALL, "rus"); cout << "Файл открыт" << endl; }
Googled a lot, tried everything that was offered on the forums, such as:
setlocale(0, ""); setlocale(LC_ALL, "Russian"); SetConsoleCP(866); SetConsoleOutputCP(866); SetConsoleCP(65001); SetConsoleOutputCP(65001); locale current_locale(""); locale::global(current_locale); SetConsoleOutputCP (CP_UTF8); setlocale(LC_CTYPE, "rus"); Nothing helped. Save me, please.