Remove outdated include; this include was breaking OS X builds using
[python.git] / Doc / library / quopri.rst
blobf4674dc3d2969932e9118d6bdd95a78eb8bbdbdc
2 :mod:`quopri` --- Encode and decode MIME quoted-printable data
3 ==============================================================
5 .. module:: quopri
6    :synopsis: Encode and decode files using the MIME quoted-printable encoding.
9 .. index::
10    pair: quoted-printable; encoding
11    single: MIME; quoted-printable encoding
13 This module performs quoted-printable transport encoding and decoding, as
14 defined in :rfc:`1521`: "MIME (Multipurpose Internet Mail Extensions) Part One:
15 Mechanisms for Specifying and Describing the Format of Internet Message Bodies".
16 The quoted-printable encoding is designed for data where there are relatively
17 few nonprintable characters; the base64 encoding scheme available via the
18 :mod:`base64` module is more compact if there are many such characters, as when
19 sending a graphics file.
22 .. function:: decode(input, output[,header])
24    Decode the contents of the *input* file and write the resulting decoded binary
25    data to the *output* file. *input* and *output* must either be file objects or
26    objects that mimic the file object interface. *input* will be read until
27    ``input.readline()`` returns an empty string. If the optional argument *header*
28    is present and true, underscore will be decoded as space. This is used to decode
29    "Q"-encoded headers as described in :rfc:`1522`: "MIME (Multipurpose Internet
30    Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text".
33 .. function:: encode(input, output, quotetabs)
35    Encode the contents of the *input* file and write the resulting quoted-printable
36    data to the *output* file. *input* and *output* must either be file objects or
37    objects that mimic the file object interface. *input* will be read until
38    ``input.readline()`` returns an empty string. *quotetabs* is a flag which
39    controls whether to encode embedded spaces and tabs; when true it encodes such
40    embedded whitespace, and when false it leaves them unencoded.  Note that spaces
41    and tabs appearing at the end of lines are always encoded, as per :rfc:`1521`.
44 .. function:: decodestring(s[,header])
46    Like :func:`decode`, except that it accepts a source string and returns the
47    corresponding decoded string.
50 .. function:: encodestring(s[, quotetabs])
52    Like :func:`encode`, except that it accepts a source string and returns the
53    corresponding encoded string.  *quotetabs* is optional (defaulting to 0), and is
54    passed straight through to :func:`encode`.
57 .. seealso::
59    Module :mod:`mimify`
60       General utilities for processing of MIME messages.
62    Module :mod:`base64`
63       Encode and decode MIME base64 data