uuencode(3tcl)
π 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, extra0bytes 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. (seeuuencode, 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 offilename,modevalue anddataπ.
π OPTIONS π
-filename nameβ makes theuuencodeoruudecodecommands 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 of0644, set this option π . Like,0755would be suitable for an executable, for example. Seechmod(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 π
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
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2002, Pat Thoyts
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms