qprint: Encode and Decode Quoted-Printable Files

This page describes, in Unix manual page style, a program available for downloading from this site which encodes binary files in the “Quoted-Printable” format used by MIME-encoded documents such as electronic mail messages with embedded images and audio files.


qprint - encode and decode Quoted-Printable files


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 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 Quoted-Printable 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, if an incorrectly encoded escape sequence is encountered, a warning message is printed. This option suppresses the warning messages; the only indication that an improperly encoded file was read will be the program returning exit status 1 at the end of the input file. In either case, incorrect escape sequences are discarded.
-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 and a summary of options.
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.


base64(1), RFC 1521

Download qprint-1.1.tar.gz (Gzipped TAR archive)

The archive contains source code for the utility, a Makefile for Unix systems, and a ready-to-run executable for 32-bit Windows platforms. Windows users may also download qprint.zip, a ZIPped archive containing the Windows executable. Prior releases remain available.

Read qprint source code (requires Acrobat Reader)


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.

Valid XHTML 1.0
by John Walker
17th December 2014
Version 1.1
The latest version of this program is available from: