I am trying to read a file which includes unsigned bytes and I am trying to read them as an integer range of [0,255].
When I look at extended ascii table, when i read that "┌", it is equal to 218, but my program takes as 195 or 226 I don't know why.
This problem happens also on a lot of characters which are in extended part(more than 128).
Why can't I read as ASCII equivalent and how can I fix this? Thanks for reply..
Here is my code,
int main()
{
unsigned int temp = 0;
int bytesread;
int fd = open("inputs.txt", O_RDONLY);
if(fd == -1)
{
printf("An error occured.. \n");
exit(-1);
}
else
{
bytesread = read(fd, &temp, 1);
}
printf("%d", temp);
return 0;
}