Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question