The Graham Utilities for OS/2 - Version 2


[Warpspeed]

[Table of Contents] [Index] [Previous] [Next]


UUEncode - Encode UU files

Summary

UUEncode encodes binary files into UU files.

Icon

Command Line Format

Usage: UUEncode {Switches} <File>

Switches

-c
Console output.
-e
encode Extended Attribute data.
-q
do not use Quote character (`) instead of space.
-s
include SUM information in the file.
-t
include TABLE information in the file.
-u
UNIX compatible file.

Description

UUEncoding is a scheme which converts 8 bit data such as programs, to a 6 bit format for transmission through 6, 7 or 8 bit (typically electronic mail) networks. Such 6 or 7 bit networks are commonly found in mainframe or UNIX operating system environments.

The UUEncoding and UUDecoding of files requires two utilities. These two utilies are UUDecode and UUEncode. UUEncode converts 8 bit data to a 6 bit format. The companion utility, UUDecode, restores the 6 bit data to the original 8 bit image.

A third utility, SUM, may be used to verify that a file has been received and correctly converted.

Encoding Method

UUENCODE breaks a group of 3 eight bit characters (24 bits) into 4 six bit characters and then add 32 (a space) to each six bit character which maps it into the readily transmittable character set.

The characters are:

!"#$%&'()*+,-./
0123456789:;=?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
Note : This translation scheme results in a file expansion of approximately 33%.

The extension of the UU file is .UUE.

UUENCODE also places some information about the original file in the header of the UU file. The original file name, size, time and date are placed in the header. This is done to provide more information to enable the encode/decode process to be checked.

-c Console output

By default, the output of UUEncode is FILE.UUE. This switch forces UUEncode to send its output to the console so that it may be redirected or piped into another program.

-e encode Extended Attribute data

The default operation of UUEncode, like every other encoder/decoder pair available, is to ignore the Extended Attribute data associated with files. This switch forces UUEncode to encode any available Extended Attribute data attached to the file and include it in the encoded data stream. The encoding works in the same manner as the actual file data which is encoded - but Extended Attribute data is encoded separately at the end of the file and is delimited using the "eabegin" keyword as opposed to "begin".

-q do not use Quote character (`) instead of space

There is a more recent encoding method which uses a single quote character (`) instead of a space. This switch forces UUENCODE to replace all spaces in the encoded character stream with quote characters. This is because some transmission mechanisms compress or remove spaces - so the spaces are replaced with quotes.

-s include SUM information in the file

This switch forces UUENCODE to include SUM information in the top of the UU file. This is to help the verification process to ensure that the decoded file has been successfully transmitted and decoded. This switch causes UUENCODE to read the file which is to be encoded twice - so it will take slightly longer. The SUM information is identical to the information produced by the SUM utility.

-t include TABLE information in the file

This switch forces UUENCODE to include TABLE information in the top of the UU file. This is to help the verification process to ensure that the decoded file has been successfully transmitted and decoded. The TABLE information is the actual encoding table which was used to encode the data. If any characters are changed as they travel through various EMail systems, then the same characters in the TABLE should also be changed. So the file should still be able to be decoded at the other end.

-u UNIX compatible file

Both OS/2 and DOS systems use a carriage return and line feed (CR/LF) character pair (CR/LF) to represent an end of line. Under UNIX the standard is to use a single line feed (LF) to represent the end of line. By default UUENCODE produces files which use the CR/LF pair for the end of line. This switch forces UUENCODE to use a single LF character for an end of line.

Examples

UUENCODE CHARSET.DAT
This will produce a UU encoded file called CHARSET.UUE. It will be a normal OS/2 text file and spaces will be used.
UUENCODE CHARSET.DAT /u
UUENCODE will produce a UNIX compatible text file called CHARSET.UUE. Quote characters will be used.
UUENCODE CHARSET.DAT /q
This will produce CHARSET.UUE - a normal OS/2 text file with spaces instead of quotes.
UUENCODE CHARSET.DAT /u
UUENCODE will produce a UNIX compatible file with quotes. Use these options if CHARSET.UUE is likely to go to a UNIX system.
UUENCODE CHARSET.DAT -stu
UUENCODE will produce a UNIX compatible file, with quotes. Full checksum information will be included in the UU file. The encoding table will also be included in the file.

Use these options if CHARSET.UUE is likely to go to a UNIX system via an unknown route. The checksum information will help the user validate that the file has been transmitted, received and decoded successfully.

UUENCODE CHARSET.DAT -c
The encoded data stream will be displayed on the console.
UUENCODE CHARSET.DAT -c | Clipbrd
The file CHARSET.DAT will be UUEncoded and the output will be piped into the Clipbrd program which places the data in the clip board.
UUENCODE CHARSET.DAT -ce
The file CHARSET.DAT will be UUEncoded to the console and any Extended Attribute data attached to the file will also be encoded.