uuencode(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

uuencode(n) πŸ’–

okay bestie, so this is the manpage for uuencode β€” the Tcl package that UU-encodes and decodes binary data. ✨ It lives in section n of the manual, and it's giving "text encoding & decoding binary data" main character energy. πŸŽ€


NAME πŸ¦‹

uuencode β€” UU-encode/decode binary data


SYNOPSIS πŸ’…

package require Tcl 8.5 9

package require uuencode ?1.1.6?

::uuencode::encode string

::uuencode::decode string

::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string)

::uuencode::uudecode (-file filename | ?--? string)

DESCRIPTION 🌸

So like, this package is a Tcl-only implementation of the uuencode(1) and uudecode(1) commands. No cap. What it does is pack binary data into printable ASCII characters, which is honestly so iconic of it. πŸ’«

  • ::uuencode::encode string β€” returns the uuencoded data. It will encode all the data you pass in, even if it's longer than the uuencode maximum line length (she does not care about your line limits, she's committed). And if the number of input bytes isn't a multiple of 3, then additional 0 bytes get added to pad the string. Padding era fr fr. 🫢
  • ::uuencode::decode string β€” decodes the encoded data you give it. Heads up bestie: this will return any padding characters as well, and it is the caller's responsibility to deal with handling the actual length of the encoded data. (see uuencode). So don't come for the package when the padding shows up, okay? 😭
  • ::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string)
  • ::uuencode::uudecode (-file filename | ?--? string) β€” UUDecode a file or block of data. And here's the gag: a file may contain more than one embedded file, so the result is a list where each element is a three element list of filename, mode value and data. Three elements. Filename, mode, data. Slay. πŸ‘‘

✨ OPTIONS ✨ πŸŽ€

  • -filename name β€” makes the uuencode or uudecode commands read their data from the named file instead of taking a string parameter. Like, pick a lane: file or string. πŸ’
  • -name string β€” the uuencoded data header line contains the suggested file name to use when unpacking the data. Use this option to change it from the default of "data.dat". Yes, "data.dat". Defaults are always a little basic, ngl. πŸ™ˆ
  • -mode octal β€” the uuencoded data header line contains a suggested permissions bit pattern expressed as an octal string. To change the default of 0644 you can set this option. For instance, 0755 would be suitable for an executable. See chmod(1). Permissions? We love a girl who knows her octals. πŸ”₯

EXAMPLES 🌈

Look at her go:

% set d [uuencode::encode "Hello World!"]
2&5L;&\\@5V]R;&0A

% uuencode::uudecode $d
Hello World!

% set d [uuencode::uuencode -name hello.txt "Hello World"]
begin 644 hello.txt
+2&5L;&\@5V]R;&0`
`
end

% uuencode::uudecode $d
{hello.txt 644 {Hello World}}

Not the begin 644 hello.txt … end moment. The way that header just works. πŸ’–


BUGS, IDEAS, FEEDBACK πŸ’€

Okay so real talk: this document, and the package it describes, will undoubtedly contain bugs and other problems. It's not a vibe, it's just the truth. 😭

Please report such in the category base64 of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist](http://core.tcl.tk/tcllib/reportlist). Please also report any ideas for enhancements you may have for either the package and/or the documentation. We want the ideas. Give us the ideas. 🫢

When proposing code changes, please provide unified diffs, i.e the output of diff -u. Periodt.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. The left-most one. Don't miss it bestie. πŸ’…

KEYWORDS ⭐

encoding, uuencode


CATEGORY πŸ¦‹

Text processing


Copyright (c) 2002, Pat Thoyts


and that's the whole page, bestie!! this one's from tcllib, version 1.1.6, and the page itself is dated uuencode(n) β€” iykyk πŸ’– stay encoded, stay iconic, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from