R
R
Rufix2019-04-28 22:29:27
C++ / C#
Rufix, 2019-04-28 22:29:27

How to correctly display Cyrillic in a C++ console application?

#include <iostream>
#include <locale>

using namespace std;

int main()
{
    setlocale(LC_ALL,"Russian");
    cout << "Номер лабораторной работы: 2;" << endl;
    cout << "ФИО: *** *** ***;" << endl;
    cout << "Номер группы: ***-**;" << endl;
    return 0;
}

Cyrillic is displayed in the form of krakozyabr I
use QT Creator as a development environment.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-04-28
@myjcom

it doesn't matter what he looks like. What encoding are you saving it in?

https://docs.microsoft.com/en-us/windows/desktop/i...
SetConsoleOutputCP( 65001 );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question