uuencode(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– uuencode β€” bestie edition πŸ’–

okay so this is the uuencode page from the tcllib crew, and it's all about UU-encoding and decoding binary data ✨ (that's the 3tcl manual, for the record, and yes it lives in the tcllib family 🫢).


✨ SYNOPSIS ✨

like, here's the whole vibe check of what you're working with:

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 this package is a Tcl-only implementation of the uuencode(1) and uudecode(1) commands β€” no cap, pure Tcl, nothing extra to install πŸ’…. What it does is pack binary data into printable ASCII characters, so your binary stuff can travel through places that only speak plain text πŸ¦‹.

  • ::uuencode::encode string β€” this one returns the uuencoded data πŸŽ€. It will encode all the data you pass in, even if that data is longer than the uuencode maximum line length (she does not care about your line limits, she ate). And heads up: if the number of input bytes is not a multiple of 3, extra 0 bytes get added to pad the string out 😌.
  • ::uuencode::decode string β€” decodes the encoded data you hand it 🌈. Lowkey important: this will return any padding characters as well, so it is the caller's job to deal with handling the actual length of the encoded data. (see uuencode, bestie β€” go read it πŸ‘€).
  • ::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string)
  • ::uuencode::uudecode (-file filename | ?--? string) β€” these two UUDecode a file or a block of data πŸ’«. And here's the tea: a single file may contain more than one embedded file, so the result comes back as a list where each element is itself a three element list of filename, mode value and data πŸ‘‘.

πŸŽ€ OPTIONS πŸŽ€

  • -filename name β€” makes the uuencode or uudecode commands read their data from the named file instead of taking a string parameter πŸ“.
  • -name string β€” the uuencoded data header line carries the suggested file name to use when unpacking the data. Use this option to change it from the default of "data.dat" ✨.
  • -mode octal β€” the uuencoded data header line carries a suggested permissions bit pattern expressed as an octal string. To change the default of 0644, set this option πŸ’…. Like, 0755 would be suitable for an executable, for example. See chmod(1) 🫢.

πŸ’– EXAMPLES πŸ’–

watch her work, fr fr:

% 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}}

😭 BUGS, IDEAS, FEEDBACK 😭

ngl, this document and the package it describes will undoubtedly contain bugs and other problems πŸ’€. Please report those in the category base64 of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist πŸ”₯. And please also report any ideas for enhancements you may have for either the package and/or the documentation β€” she wants to hear it 🫢.

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

Also, note further that attachments are strongly preferred over inlined patches πŸ™ˆ. You can make an attachment 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 πŸ‘‘.


πŸ”‘ KEYWORDS πŸ”‘

encoding, uuencode


🌈 CATEGORY 🌈

Text processing


Copyright (c) 2002, Pat Thoyts


okay that's the whole page, bestie β€” you're officially uuencode-pilled πŸ§šπŸ’…. this little icon came from tcllib, version 1.1.6, and it's the uuencode(3tcl) manual β€” go forth and encode something, periodt πŸ’–βœ¨

πŸ“¦ where this page comes from