Sujet : Re: ASCII to ASCII compression.
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 06. Jun 2024, 21:16:54
Autres entêtes
Organisation : None to speak of
Message-ID : <87jzj1zv0p.fsf@nosuchdomain.example.com>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Malcolm McLean <
malcolm.arthur.mclean@gmail.com> writes:
On 06/06/2024 17:55, bart wrote:
On 06/06/2024 17:25, Malcolm McLean wrote:
>
Not strictly a C programming question, but smart people will see
the relavance to the topicality, which is portability.
>
Is there a compresiion algorthim which converts human language
ASCII text to compressed ASCII, preferably only "isgraph"
characters?
>
So "Mary had a little lamb, its fleece was white as snow".
>
Would become
>
QWE£$543GtT£$"||x|VVBB?
What's the problem with compressing to binary (using existing,
efficient utilities), then turning that binary into ASCII (like Mime
or Base64)?
Because if a single bit flips in a zip archive, it's likely the entire
archive will be lost. This scheme is robust. We can emed compressed
text in programs, and if it is corruped, only a single line will
become unreadable.
You're adding requirements that you didn't mention in your original
post.
Compressing to binary and then encoding with base64 or something similar
meets your original requirements. You've added requirements for partial
robustness against single-bit errors and, apparently, compressing each
line independently.
You could use xz+base64 on each line, but you won't get very good
compression ratios if you don't give the compressor a large amount of
(potentially redundant) data to work with.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */