Encode takes a binary file as input and encodes it into a printable format that can be transferred via email.
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.
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.