uuencode(3trf)
β¨ uuencode(3trf) β¨
okay bestie, welcome to the manual page for uuencode, hanging out in section 3trf like the icon it is π
πΈ NAME πΈ
uuencode β Encoding "uuencode" π
π¦ SYNOPSIS π¦
package require Tcl ?8.2?
package require Trf ?2.1.3?
uuencode ?options...? ?data?
π DESCRIPTION π
So, uuencode 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 for the overview of the entire package, no cap.
Here's the vibe of what this encoding does: it takes every block of three bytes and turns it into a block of four bytes, and every single one of those output bytes is printable β like, 7bit ASCII printable π«Ά. Which means the result is valid UTF-8 too, bestie. It's lowkey the same algorithm as base64, except the mapping from 6-bit fragments to printable bytes is different. Same energy, different fit β¨.
uuencode ?options...? ?data?
-mode encode|decodeβ this option has to be present, it's mandatory fr fr, and it's always understood by the encoding. In immediate mode, the argument value tells you which operation to use. For an attached encoding, it tells you the operation used for writing β reading will automatically use the reverse operation, how convenient is that π. (The whole immediate vs attached thing gets explained in the IMMEDIATE versus ATTACHED section below, don't worry.) And beyond the argument values listed right here, all unique abbreviations are recognized too π.encodeconverts from arbitrary (most likely binary) data into the representation described above;decodedoes the reverse.-attach channelβ whether this option is there or not is literally what determines the main operation mode of the transformation, main character energy honestly π . If it's present, the transformation gets stacked onto the channel whose handle you handed over, and it runs in attached mode. More on that in IMMEDIATE versus ATTACHED. If it's absent, the transformation runs in immediate mode and the options listed below are recognized. Again: IMMEDIATE versus ATTACHED β¨.-in channelβ this one is legal if and only if the transformation is being used in immediate mode. It gives you the handle of the channel that the data to transform has to be read from π. And if the transformation is in immediate mode but this option is absent, then the data to transform is expected as the last argument to the transformation.-out channelβ also legal if and only if the transformation is in immediate mode, same rules bestie. It gives the handle of the channel that the generated transformation result gets written to π. And if the transformation is in immediate mode and this option is absent, the generated data is returned as the result of the command itself. Slay.
π NOTES π
- The encoding buffers 2 bytes. that's it, that's the note π
π§ IMMEDIATE VERSUS ATTACHED π§
The transformation distinguishes between two main ways of using it β two whole modes, a whole duality, it's giving main character and their shadow self π. Those are the immediate and attached operation modes.
For the attached mode, you use the -attach option to associate the transformation with an existing channel π«Ά. While the command is executing, no transformation is performed β instead, the channel itself gets changed in such a way that from then on, all data written to it or read from it passes through the transformation and gets modified by it according to the definition above. Obsessed, honestly. 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. Periodt.
In the second mode β which you can detect by the absence of the -attach option β the transformation immediately takes data from either its commandline or a channel, transforms it, and then either returns the result as the result of the command or writes it into a channel π. The mode is named after the immediate nature of its execution. Makes sense, iconic naming tbh.
Where the data is taken from, and where it's delivered to, is governed by the presence and absence of the -in and -out options β¨. But 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 the current one, because that version and earlier ones had trouble dealing with \0 characters embedded into either input or output π. So yeah, it's legacy lore, iykyk.
π₯ SEE ALSO π₯
ascii85, base64, bin, hex, oct, otp_words, quoted-printable, trf-intro, uuencode
π KEYWORDS π
base64, encoding, uuencode
π COPYRIGHT π
Copyright (c) 1996-2003, Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page, bestie, you ate that πβ¨ this was the Trf transformer commands page, version 2.1.3, and it's filed under uuencode(3trf) β go forth and encode responsibly, ily ππ¦πΈ
π¦ 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