Uuencoding

Uuencoding refers to the use of the uuencode(1) and uudecode(1) utilities for transfer of binary files between Unix hosts.


Structure

A uuencoded file looks like:

begin 644 cat.txt
#0V%T
`
end

The begin line includes the file permissions and name.

Each line is a chunk of binary data, up to 45 bytes of original data or 60 bytes of encoded data. Each line is prefixed by a character representing the original size of the chunk. The most common prefixes are M, which represents a full 45 bytes, and `, which represents an empty line.

The end line always follows one such empty line.

The above file is the result of uuencoding "Cat".


History

Uuencoding was developed in response to poor handling of different character encodings and character sets across message transfer agents. In particular, this addressed the need to send files between Unix systems.

The names and designs of the uuencode(1) and uudecode(1) utilities comes from the Unix-to-Unix Copy protocol (UUCP).


CategoryRicottone