Read text and print each (byte) character in separate line
- by user2967663
preforming this code to read file and print each character \ (byte) in separate line
works well with ASCII
void
preprocess_file (FILE *fp)
{
int cc;
for (;;)
{
cc = getc (fp);
if (cc == EOF)
break;
printf ("%c\n", cc);
}
}
int
main(int argc, char *argv [])
{
preprocess_file (stdin);
exit (0);
}
but when i use it with UTF-8 encoded text it shows unredable character
such as
ï
»
?
?
§
?
„
?
…
?
¤
?
´
?
and advice ?
Thanks