Hi everyone. I can’t get rid of the bad encoding in the MinGW compiler for Windows. The language of writing C code, the output is some kind of game. enter image description here

enter image description here

Unfortunately, the method with Fallback_encoding did not help. The compiler continues to create what he wants. The path to the Cyrillic project does not contain.

The source code of the project itself :

#include <stdio.h> #include <stdlib.h> int main () { char card_name[3]; puts("Введите название карты: "); scanf("%2s", card_name); int val = 0; if (card_name[0] == 'K') { val = 10; } else if (card_name[0] == 'Q') { val = 10; } else if (card_name[0] == 'J') { val = 10; } else { atoi(card_name); } printf("Ценность карты: %i\r\n:", val); return 0; } 
  • one
    What does the editor have to do with it? You have the same output in the console curve, but not him. - PinkTux
  • And what could be the problem? For the first time I come across this, Cyrillic normally compiled before. So far, nothing has helped. - Klugge
  • one
    The problem is that in the source you have one encoding, and in the console - another. More details . - PinkTux
  • one

1 answer 1

All figured out! Thank you very much PinkTux for the correct guidance.

1) Go to cmd and right mouse button -> properties -> Fonts -> Lucida Console

2) Then we save and write to the console сhcp The текущая кодовая страница displayed, it turned out to be 886 (DOC format)

3) After that, write to the console сhcp 65001 and сhcp 65001 life!

The code started normally, Cyrillic works fine.