A
A
A1lexen2016-05-03 16:10:00
C++ / C#
A1lexen, 2016-05-03 16:10:00

After entering the word is not displayed in Russian, how to fix it?

9bec29fa69764a249424c73b78bbcd95.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Threy, 2016-05-03
@A1lexen

In your case, it's easier to use SetConsoleOutputCP and SetConsoleCP . It's just that setlocale only works with the output stream, and the user who will enter the name into the variable does not specify an encoding. That is, the user sends one byte from the console with a character value that matches the console encoding (and this is OEM-866, if I'm not mistaken). And upon receiving the value from the user, the console spits it out in the "locale" representation you declared.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question