He worked on Linux , there were no problems with encodings at all. Now it was necessary to work on Windows .
Everything seems to be good, but there were no Russian symbols, only krakozyabry. Changed to others when:
SetConsoleCP(1251); SetConsoleOutputCP(1251); setlocale(LC_ALL, "Russian");
I dug in the registry, changed the console font, in general, everything that is adequate in Google . Then I decided to accidentally change
SetConsoleCP(CP_UTF8); (of course also
There was a lot of joy, the native language in the console. But a couple of days have passed and now it is necessary to enter more Russian, but the program immediately lays down. Judging by the debugger, the line is just empty.
How can you fix this?
Check the encoding of the compiled * .cpp files, they must be in the encoding in which you output the text.