1

I am trying to print out cyrillic characters in my output in one of my programs. However, they are coming out as all question marks when the program runs. Why would this be and how would I be able to fix it? I will leave my code below:

 while (languageInput != 1 && languageInput != 2) // if user enters invalid input
{
    cout<< u8"Enter 1 for Russian(Русский) or 2 for English: ";
    cin >> languageInput;
    cout << endl; 
}
if (languageInput == 1) // русский
{
    cout << u8"Как вас зовут? ";
    cin >> name; //ввод имени
    cout << endl;
    cout << u8"Привет " << name << u8" и добро пожаловать в класс CS113!" << endl; //выпуск
}

1 Answers1

0

Try to insert this at the beginning of main function:

setlocale(LC_ALL, "Russian");

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-ask). – Community Sep 10 '21 at 17:30