In my university I have a coursework to write a C project that supports cyrillic input and text on the console and writing to files. But they only allow to use char data type and printf scanf functions.
For the past two days I've been researching how to do that, and found solutions that if you set the encoding to UTF16 and use wchar_t only then cyrillic characters are support. But that makes me use wchar_t functions wprintf, wscanf etc. Not really an option.
Here's the code I have right now but it prints weird symbols on the console.
int main(void) {
setlocale(LC_ALL, "bg-BG");
char str[80];
printf("Въведи текст: "); //Enter text:
scanf("%s", str);
printf("Ти въведе: %s", str); //You entered:
getch();
return 0;
}
Is there something I'm missing or misunderstanding? As far as I know C/C++ ASCII table supports only english characters with range 0 - 127.