E
E
evg_962018-03-17 11:42:21
C++ / C#
evg_96, 2018-03-17 11:42:21

Why is Cyrillic not displayed from C in the windows console?

#include <locale.h>
#include <stdio.h>

int main(void)
{
    setlocale(LC_ALL, "Rus");

    int num = 1;

    printf("Привет мир!");

    _getch();

    return 0;
}

Googling found 2 methods of localization, but none worked. (another way with connecting Windows.h) How can I still output Cyrillic to the console?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2018-03-17
@res2001

If it's quite simple and wooden, then save the source code in cp866 encoding and rebuild.
And if it’s difficult and correct, then learn the mat.chast. You can start from here , just look at my comment under the article, once again it’s too lazy to repeat everything - this issue has been discussed here more than once. In general, this is the most common question among Russian-speaking novice C programmers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question