[DiscordArchive] does string block offsets start with 1 or 0 ? i mean string ends with empty byte so string `Hangar`
[DiscordArchive] does string block offsets start with 1 or 0 ? i mean string ends with empty byte so string `Hangar`
Archived author: stoneharry • Posted: 2022-11-08T18:24:27.418000+00:00
Original source
The standard I am referring to is C strings. The uint stored in each record string field is an offset into the string block. The reader reads from that position until a empty byte is found.
Archived author: stoneharry • Posted: 2022-11-08T18:24:43.414000+00:00
Original source
If you follow that convention it doesn't matter how you write it, it will work
Archived author: Rymercyble • Posted: 2022-11-08T18:26:11.661000+00:00
Original source
and what does it seems like (what im doing) ?
i dont know how to say that in english properly
Archived author: stoneharry • Posted: 2022-11-08T18:27:20.421000+00:00
Original source
You are trying to put more structure to it. Sometimes there will be an empty byte at the start of the string block, sometimes not. Sometimes there will be lots of empty bytes, sometimes just 1. It's not guaranteed.
Archived author: Rymercyble • Posted: 2022-11-08T18:27:33.397000+00:00
Original source
to me placing empty byte and then string is just manual way not "native" how to achieve c string format but i could be wrong
Archived author: stoneharry • Posted: 2022-11-08T18:28:34.665000+00:00
Original source
The empty byte at the start of the block is because an empty string is typically the first thing to be written
Archived author: stoneharry • Posted: 2022-11-08T18:28:41.509000+00:00
Original source
But not always
Archived author: Rymercyble • Posted: 2022-11-08T18:30:14.810000+00:00
Original source
my brain hurts
Archived author: stoneharry • Posted: 2022-11-08T18:31:03.155000+00:00
Original source
If you read from position 0 and immediately encounter a empty byte (string terminator) then you know you've finished reading and return the result (empty string)
Archived author: stoneharry • Posted: 2022-11-08T18:31:16.708000+00:00
Original source
An empty string doesn't have to be at the start of the string block