Path: ...!feed.opticnetworks.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lew Pitcher Newsgroups: comp.lang.c Subject: Re: ASCII to ASCII compression. Date: Mon, 10 Jun 2024 00:45:08 -0000 (UTC) Organization: A noiseless patient Spider Lines: 35 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 10 Jun 2024 02:45:09 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7c686c96fa35450f6977fa07b8dd8797"; logging-data="4097701"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/UAF8SxslKF3YJJDuNhcShuCDHB8XUHS4=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:mbYtZp4+CKlttQjtzu8QeL3rlbg= Bytes: 2255 On Thu, 06 Jun 2024 17:25:37 +0100, 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? I'm afraid that you have conflicting requirements here. In effect, you want to take an array of values (each within the range of 0 to 127) and a) make the array shorter ("compress it"), and b) express the individual elements of this shorter array with a range of 96 values ("isgraph() characters") Because you reduce the number of values each result element can carry, each result element can only express a fraction (96/128'ths) of the corresponding source element. Thus, with the isgraph() requirement, the result will take /more/ elements to express the same data as the source did. However, you want /compression/, which implies that you want the result to be smaller than the source. And, therein lies the conflict. Can you help clarify this for me? -- Lew Pitcher "In Skills We Trust"