encode

Section: User Commands (1)
Updated: 11 Sept 1993
Index Return to Main Contents
 

NAME

encode - encode binary files into printable format  

SYNOPSIS

encode [ -i <inputfile> ] [ -o <outputfile> ] [ -n <name> ] [ -c <charset> ]  

DESCRIPTION

Encode takes a binary file as input and encodes it into a printable format that can be transferred via email.  

OPTIONS

-i
<inputfile>
specifies the file to read input from. If this argument is omitted, stdin is used.
-o
<outputfile>
specifies the file to write output to. If this argument is omitted, stdout is used.
-n
<name>
specifies the filename to store in the output file. This filename will be the default filename used to create the decoded file. If this argument is omitted, the name of the input file is used. If the input file is stdin, the string "stdin" is used.
-c
<charset>

specifies the character set to encode with. A character set is specified as a list of ranges. A range is either a single character code or two character codes separated by a hyphen, e.g. 23 or 45-51. A list of ranges is 1 or more ranges separated by commas, e.g. 23,45-51. Overlaps in ranges are not a problem; each character is counted only once. A character code is any valid number between 0 and 255 decimal, or the equivalent in octal, hex, or raw escaped characters. Note, however, that it only makes sense to use printable characters in the range 32-126. Octal codes must be preceeded by a 0, e.g. 023. Hex codes must be preceeded by 0x, e.g. 0x6e. Raw escaped character codes may be specified with a backslash followed by the character itself, e.g. \t. If this argument is omitted, the entire set of printable characters, 32-126, is used. The character set is included in the encoded file in decimal notation with any overlaps removed regardless of how it is specified on the command line.

 

OUTPUT FORMAT

The first line of the output contains the keyword BEGIN followed by the file mode of the input file in octal, the filename to be used when creating the decoded file, and the character set used. Immediately following this line is the encoded data, using only the characters in the specified character set. Output width is limited to 79 columns by inserting a newline every 79 characters. The encoded data terminates when two consecutive newlines are seen. Immediately following the second newline is a line containing the keyword END and a 32 bit checksum of the input file in hex.  

SEE ALSO

decode(1),


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
OUTPUT FORMAT
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 17:08:58 GMT, July 07, 2022