I'm making a program in C for a project where it as to print to a file everything it prints to the console. The problem is that I have to print some special characters like 'Ç', so I use the ascii codes and it printd fine to the console however what it prints to the file is incorrect. Here is an example:
printf(" %c", 128);
output to console: Ç
fprintf(output, " %c", 128);
output to file: €
I ran the command chcp in cmd and it tells me I'm using code page 850 and I used those asci codes, so I don't know what is the problem. The program writes to a notepad txt file.