ascii85(3trf)
ascii85 π (that's the 3trf one, bestie)
okay so. you know how sometimes you have a whole pile of bytes and you need them to be, like, text? that's this. no cap.
β¨ NAME β¨
ascii85 β encoding "ascii85" π
β¨ SYNOPSIS β¨
package require Tcl ?8.2?
package require Trf ?2.1.3?
ascii85 ?options...? ?data?
β¨ DESCRIPTION β¨
so ascii85 is one of several data encodings that the package trf brings to the party. if you wanna see the whole squad, go peek at trf-intro, it's giving overview energy. π«Ά
the way this encoding works is: every block of four bytes gets transformed into the Ascii85 representation, exactly as defined in the 'Postscript Reference Manual' (2nd Edition, section 3.13, page 129). iconic, honestly. πβ¨
ascii85 ?options...? ?data?
-mode encode|decodeβ okay bestie, this one is mandatory, it has to be present, and it is always understood by the encoding. no skipping it. π
in immediate mode, the argument value tells you which operation to use. for an attached encoding, it specifies the operation to use for writing β and reading will automatically use the reverse operation. (more on these two terms down in IMMEDIATE versus ATTACHED.)
beyond the argument values listed above, all unique abbreviations are recognized too. encode converts from arbitrary (most likely binary) data into the described representation; decode does the reverse.
-attach channelβ the presence or absence of this option is literally what decides the main operation mode of the transformation. main character behaviour fr. π
if it's present, the transformation gets stacked onto the channel whose handle you handed over, and it runs in attached mode. more in IMMEDIATE versus ATTACHED.
if it's absent, the transformation is used in immediate mode and the options listed below are recognized. again: IMMEDIATE versus ATTACHED.
-in channelβ this option is legal if and only if the transformation is used in immediate mode. it gives you the handle of the channel that the data to transform has to be read from. π
if the transformation is in immediate mode and this option is absent, the data to transform is expected as the last argument to the transformation.
-out channelβ same deal: this option is legal if and only if the transformation is used in immediate mode. it gives you the handle of the channel that the generated transformation result gets written to. π―
if the transformation is in immediate mode and this option is absent, the generated data is returned as the result of the command itself.
β¨ IMMEDIATE VERSUS ATTACHED β¨
the transformation distinguishes between two main ways of using it, bestie. these are the immediate and attached operation modes. two vibes, one encoding. π¦
for the attached mode, you use the option -attach to associate the transformation with an existing channel. during the execution of the command no transformation is performed β instead the channel is changed in such a way that, from then on, all data written to or read from it passes through the transformation and is modified by it according to the definition above. so it's justβ¦ permanently in its era. β¨
this attachment can be revoked by executing the command unstack for the chosen channel. and heads up: this is the only way to do this at the Tcl level. π
in the second mode, which you can detect by the absence of the option -attach, the transformation immediately takes data from either its commandline or a channel, transforms it, and returns the result either as the result of the command, or writes it into a channel. the mode is named after the immediate nature of its execution. instant. no waiting. β‘
where the data is taken from, and delivered to, is governed by the presence and absence of the options -in and -out. and ngl, you should note that this ability to immediately read from and/or write to a channel is an historic artifact β it was introduced at the beginning of Trf's life, back when Tcl version 7.6 was current, because that version and earlier ones had trouble dealing with \0 characters embedded into either input or output. so likeβ¦ respect your elders, it's here for a reason. π«‘
β¨ SEE ALSO β¨
ascii85, base64, bin, hex, oct, otp_words, quoted-printable, trf-intro, uuencode β the whole friend group, go say hi. π
β¨ KEYWORDS β¨
ascii85, encoding, postscript
β¨ COPYRIGHT β¨
Copyright (c) 1996-2003, Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page, you ate it, no crumbs. go encode something cute. π
this one came out of the Trf transformer commands manual, and it's tagged version 2.1.3, filed under ascii85(3trf) β mwah, sending you the slay-est of goodbyes ππβ¨
π¦ where this page comes from
- debian bookworm: tcl-trf-doc 2.1.4-dfsg3-2.1
- debian trixie: tcl-trf-doc 2.1.4-dfsg3-8
- ubuntu jammy: tcl-trf-doc 2.1.4-dfsg3-2.1build1
- ubuntu noble: tcl-trf-doc 2.1.4-dfsg3-3
- ubuntu questing: tcl-trf-doc 2.1.4-dfsg3-8
- ubuntu resolute: tcl-trf-doc 2.1.4-dfsg3-8build1
- ubuntu stonking: tcl-trf-doc 2.1.4-dfsg3-9build1
- Copyright (c) 1996-2003, Andreas Kupries <andreas_kupries@users.sourceforge.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms