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
When writing a console program for Windows, you need to consider:
1. In what encoding in the text of the program are your Russian lines.
2. Console encoding may vary. By default, the encoding in the Windows console is 866, you can switch to 1251.
3. The console API and stdlib of the C language do not automatically recode anything.
4. The compiler does not recode anything, it does not care what you have in quotes.
5.If you output without recoding, then you can get a normal result only if the console encoding matches the encoding of your Russian characters in the source code.
In order not to depend on the console encoding, you can:
1. do not display Russian letters
2. Get confused with transcoding to console encoding before output. It's pretty easy, just half a day of reading MSDN and tests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question