Message from @spaqin
Discord ID: 473822402409660426
it's prints that all out backwards in the terminal
You could've also somehow messed up the params?
looks like your encoding is wack
But I want that in a plain text
Or it could be UTF8
if it's anything except ASCII you can't just reverse the bytes and have it work
Or whatever utf
@Goz3rr no no
```
void reverseArray(char* mmappedData, int start, int end) {
int tmp;
while(start < end) {
tmp = mmappedData[start];
mmappedData[start] = mmappedData[end];
mmappedData[end] = tmp;
start++;
end--;
}
}
```
In place reversal
you are reading bytes
a char is a byte
No bits were turned in reverse
Pass me the fwrite incantation you use
incantation lol
```
fwrite(mmappedData, 1, filesize, f);
```
im stealing that
Can't fuck that up lmao
mmapedData is a char* array from a mmap() command
1 is the start of the array
compare your two files in a hex editor
ah ok sorry
one moment
instead of a text editor
to begin with
Tru
hav no idea
you probably succesfully reversed all bytes, but your text editor is interpreting it as the wrong encoding
so that's the result of the write
And here's what happens in fwrite
It's plain text
How could there be an encoding fuck up
Can I force it to output plain text
that's not how files work
you output bytes
it's up to the reading program to interpret them
so then why is it ok with write, but then i cannot use that in fwrite?
because your terminal correctly displays it as ascii
gedit probably does with utf8 or something and you happened to end up in the chink codepoints
actually not utf8