Table of Contents

Name

uuencode - encode a binary file

Synopsis

uuencode [-m][file] decode_pathname

Description

The uuencode utility shall write an encoded version of the named input file, or standard input if no file is specified, to standard output. The output shall be encoded using one of the algorithms described in the STDOUT section and shall include the file access permission bits (in chmod octal or symbolic notation) of the input file and the decode_pathname, for re-creation of the file on another system that conforms to this volume of IEEE Std 1003.1-2001.

Options

The uuencode utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.

The following option shall be supported by the implementation:

-m
Encode the output using the MIME Base64 algorithm described in STDOUT. If -m is not specified, the historical algorithm described in STDOUT shall be used.

Operands

The following operands shall be supported:

decode_pathname

The pathname of the file into which the uudecode utility shall place the decoded file. Specifying a decode_pathname operand of /dev/stdout shall indicate that uudecode is to use standard output. If there are characters in decode_pathname that are not in the portable filename character set the results are unspecified.

file
A pathname of the file to be encoded.

Stdin

See the INPUT FILES section.

Input Files

Input files can be files of any type.

Environment Variables

The following environment variables shall affect the execution of uuencode:

LANG
Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
LC_ALL
If set to a non-empty string value, override the values of all the other internationalization variables.
LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files).
LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
NLSPATH
Determine the location of message catalogs for the processing of LC_MESSAGES .

Asynchronous Events

Default.

Stdout

uuencode Base64 Algorithm

The standard output shall be a text file (encoded in the character set of the current locale) that begins with the line:


"begin-base64%s%s\n", <mode>, <decode_pathname>

and ends with the line:


"====\n"

In both cases, the lines shall have no preceding or trailing <blank>s.

The encoding process represents 24-bit groups of input bits as output strings of four encoded characters. Proceeding from left to right, a 24-bit input group shall be formed by concatenating three 8-bit input groups. Each 24-bit input group then shall be treated as four concatenated 6-bit groups, each of which shall be translated into a single digit in the Base64 alphabet. When encoding a bit stream via the Base64 encoding, the bit stream shall be presumed to be ordered with the most-significant bit first. That is, the first bit in the stream shall be the high-order bit in the first byte, and the eighth bit shall be the low-order bit in the first byte, and so on. Each 6-bit group is used as an index into an array of 64 printable characters, as shown in uuencode Base64 Values . Table: uuencode Base64 Values

uuencode Historical Algorithm




Stderr

Output Files

Extended Description

Exit Status

Consequences of Errors

Application Usage

Examples

Rationale

Future Directions

See Also

Copyright

The character referenced by the index shall be placed in the output
string.
The output stream (encoded bytes) shall be represented in lines of
no more than 76 characters each. All line breaks or other
characters not found in the table shall be ignored by decoding software
(see uudecode ).
Special processing shall be performed if fewer than 24 bits are available
at the end of a message or encapsulated part of a
message. A full encoding quantum shall always be completed at the
end of a message. When fewer than 24 input bits are available in
an input group, zero bits shall be added (on the right) to form an
integral number of 6-bit groups. Output character positions that
are not required to represent actual input data shall be set to the
character ’=’ . Since all Base64 input is an integral
number of octets, only the following cases can arise:
The final quantum of encoding input is an integral multiple of 24
bits; here, the final unit of encoded output shall be an
integral multiple of 4 characters with no ’=’ padding.


Table of Contents