Ask Lemmy
A Fediverse community for open-ended, thought provoking questions
Rules: (interactive)
1) Be nice and; have fun
Doxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them
2) All posts must end with a '?'
This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?
3) No spam
Please do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.
4) NSFW is okay, within reason
Just remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com.
NSFW comments should be restricted to posts tagged [NSFW].
5) This is not a support community.
It is not a place for 'how do I?', type questions.
If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.
6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online
Reminder: The terms of service apply here too.
Partnered Communities:
Logo design credit goes to: tubbadu
view the rest of the comments
I don't want to sound dumb but I have read this several times since you responded and I have no clue what this means. Like I know what all of these words mean but I can't put them into context with what I said. I wasn't talking about compression algorithms. I'm so sorry. )=
UTF-8 text is inherently wasteful.
Say you have binary data and you want to encode it with UTF-8. For simplicity let's say the spec goes up to 2^16 codepoints.
Now each one of these codepoints (a unique character) this can be able to be encoded in 2 bytes directly, but because UTF-8 encoding is inherently wasteful, it needs more bytes than that on average. The reason is UTF-8 ensures that a valid string doesn't contain a null byte (eight 0 bits, byte aligned). Useful for things like filenames, databases, etc. This means that some bit strings are nonsensical to UTF-8. The majority of them, actually.
Its the same thing with English text, except instead of 1s and 0s we have letters and punctuation. English uses multiple letters per syllable, with certain combonations of letters being nonsensical, although a valid string. It's inherently wasteful but its nice for reading.
GZip compression will minimize the effects of both of these. Although, because of laws of entropy, you will always need to store some kind of information which will let you decompress it into the original English Text+UTF-8 string.
Basically, it's a fancy computer science way to store, in less bytes a UTF-8 + English text using "this is UTF-8 text" and "this is English text" and some information to detangle it all. Although it is not stored that way. It's all just bits to GZip, both input and output. Both UTF-8 and English text inherently create patterns, And GZip compresses away patters. Rather well too.
This also means that random data is incompressible because there's no pattern. Unless you want to do lossily which is the literal only way Internet video streaming works so well.