I am trying to reading in a file that contains characters in UTF-8 format.
FILE * f = fopen(argv[1], "r");
if(f == NULL){
printf("cannot open %s\n", argv[1]);
exit(-1);
}
unsigned int c = getc();
while(c != EOF){
printf("%d\n", c); // UB
c = getchar();
}
How do I read the files in so that they are in bit representation? For example that it would look like: 0xA3
.
Right now it's printing actual integers.
Basically, how do I read in characters in bit wise format?