The Graham Utilities for OS/2 - Version 2


[Warpspeed]

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


XXEncode - Encode XX files

Summary

XXEncode encodes binary files into XX files.

Icon

Command Line Format

Usage: XXEncode {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

XXEncoding 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 XXEncoding and XXDecoding of files requires two utilities. These two programs are XXDecode and XXEncode. XXEncode converts 8 bit data to a 6 bit format. The companion utility, XXDecode, 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

XXENCODE breaks a group of 3 eight bit characters (24 bits) into 4 six bit characters and then adds 32 (a space) to each six bit character which maps it into the readily transmittable character set. It is basically identical to UU encoding except that the base encoding character set is different. XX encoding came after UU encoding due to problems which UU encoding had with certain character set translation schemes - most notably EBCDIC.

The characters are:

+-0123456789ABCD
EFGHIJKLMNOPQRST
UVWXYZabcdefghij
klmnopqrstuvwxyz
Note : This translation scheme results in a file expansion of approximately 33%.

The extension of the XX file is .XXE.

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

-c Console output

By default, the output of XXEncode is FILE.XXE. This switch forces XXEncode to send its output to the console to enable it to be redirected or piped into another program.

-e encode Extended Attribute data

The default operation of XXEncode, like every other encoder/decoder pair available, is to ignore the Extended Attribute data associated with files. This switch forces XXEncode 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 that the actual file data 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 XXENCODE to replace all spaces in the encoded character stream with quote characters. This is because some transmission mechanisms compress or remove spaces. Thus, the spaces are replaced with quotes.

-s include SUM information in the file

This switch forces XXENCODE to include SUM information in the top of the XX file. This is to help the verification process to ensure that the decoded file has been successfully transmitted and decoded. This switch causes XXENCODE 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 XXENCODE to include TABLE information in the top of the XX 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. Thus 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 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, XXENCODE produces files which use the CR/LF pair for the end of line. This switch forces XXENCODE to use a single LF character for an end of line.

Examples

XXENCODE CHARSET.DAT
This will produce a XX encoded file CHARSET.XXE. It will be a normal OS/2 text file and spaces will be used.
XXENCODE CHARSET.DAT /u
XXENCODE will produce a UNIX compatible text file called CHARSET.XXE. Space characters will be used.
XXENCODE CHARSET.DAT /q
This will produce CHARSET.XXE - a normal OS/2 text file with spaces instead of quotes.
XXENCODE CHARSET.DAT /u
XXENCODE will produce a UNIX compatible file with quotes. Use these options if CHARSET.XXE is likely to go to a UNIX system.
XXENCODE CHARSET.DAT -stu
XXENCODE will produce a UNIX compatible file with quotes. Full checksum information will be included in the XX file. The encoding table will also be included in the file. Use these options if CHARSET.XXE 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.
XXENCODE CHARSET.DAT -c
The encoded data stream will be output to the console.
XXENCODE CHARSET.DAT -c | Clipbrd
The file CHARSET.DAT will be XXEncoded and the output will be piped into the Clipbrd program which places the data in the clip board.
XXENCODE CHARSET.DAT -ce
The file CHARSET.DAT will be XXEncoded to the console and any Extended Attribute data attached to the file will also be encoded.