Answer the question
In order to leave comments, you need to log in
C: how to print pseudographics to a file?
It outputs the character corresponding to the asci-code (in this case, any pseudo-graphics) to the console, but for some reason it prints Cyrillic to the file. How to print pseudographics to a file?
#include <stdio.h>
int main(){
FILE * pF = fopen("output.txt", "w");
char black = 219; /*аски код черного квадратика */
printf("%c\n", black); /*нормально*/
fprintf(pF, "%c\n", black ); /*лажа, выводит 'Ы' */
return 0;
}
Answer the question
In order to leave comments, you need to log in
Most likely, everything is written to the file correctly - check with a HEX editor. It's just that the program in which you then open the file to look at the result uses a Cyrillic code page instead of pseudographics, probably CP1251. Put CP866 - you will have black squares.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question