qprint(1) encode / decode file as RFC 1521 MIME Quoted-Printable


qprint -d|-e [ options ] [ infile [ outfile ] ]


The MIME (Multipurpose Internet Mail Extensions) specification RFC 1521 and successors) defines a mechanism for encoding text consisting primarily of printable ASCII characters, but which may contain characters (for example, accented letters in the ISO 8859 Latin-1 character set) which cannot be encoded as 7-bit ASCII or are non-printable characters which may confuse mail transfer agents.

qprint is a command line utility which encodes and decodes files in this format. It can be used within a pipeline as an encoding or decoding filter, and is most commonly used in this manner as part of an automated mail processing system. With appropriate options, qprint can encode pure binary files, but it's a poor choice since it may inflate the size of the file by as much as a factor of three. The Base64 MIME encoding is a better choice for such data.


-b, --binary
Treat the input (when encoding) or output (when decoding) file as pure binary, and process end of line sequences as binary data. Encoding and decoding a file with this option preserves the exact sequence of bytes in the input, but does not perform the translation of end of line sequences normally performed by Quoted-Printable encoding.
Print program copyright information.
-d, --decode
Decodes the input, previously created by qprint, to recover the original input file.
-e, --encode
Encodes the input into an output text file containing its qprint encoding.
-i, --ebcdic
Encode ASCII characters for which no equivalent exists in the EBCDIC character set. This renders files more portable when transported to EBCDIC systems.
-n, --noerrcheck
Suppress error checking when decoding. By default, upon encountering a non white space character which does not belong to the qprint set, or discovering the input file is incorrectly padded to a multiple of four characters, qprint issues an error message and terminates processing with exit status 1. The -n option suppresses even this rudimentary error checking; invalid characters are silently ignored and the output truncated to the last three valid octets if the input is incorrectly padded.
-p ,--paranoid
Every character in the input file will be encoded as an escape sequence. You must also specify the -b or --binary option if you wish end of line sequences to be escaped as well. This option is a last resort when there's no other way to transmit the file, but an encoding explicitly designed for binary data such as Base64 is a much more economical choice.
-u, --help
Print how-to-call information.
Print program version information.


qprint returns status 0 if processing was completed without errors, 1 if an I/O error occurred or errors were detected in decoding a file which indicate it is incorrect or incomplete, and 2 if processing could not be performed at all due, for example, to a nonexistent input file.


If no infile is specified or infile is a single ``-'', qprint reads from standard input; if no outfile is given, or outfile is a single ``-'', output is sent to standard output. The input and output are processed strictly serially; consequently qprint may be used in pipelines. The program can process files of any size supported by the system containing text lines of arbitrary length.


Encoding a file with a large percentage of non-ASCII characters may dramatically increase its size. This is inherent in the design of Quoted-Printable encoding.

Please report bugs and documentation errors to [email protected].


John Walker

This software is in the public domain. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, without any conditions or restrictions. This software is provided ``as is'' without express or implied warranty.

This is version 1.1 of qprint. The current version of this program may be downloaded from http://www.fourmilab.ch/webtools/qprint.