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