19.9. quopri MIME quoted-printable

: Lib/quopri.py


RFC 1521: "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies" quoted-printable quoted-printable ; base64 base64

quopri.decode(input, output, header=False)

input output input output header RFC 1522: "MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text" "Q"-

quopri.encode(input, output, quotetabs, header=False)

Encode the contents of the input file and write the resulting quoted-printable data to the output file. input and output must be binary file objects. quotetabs, a non-optional flag which controls whether to encode embedded spaces and tabs; when true it encodes such embedded whitespace, and when false it leaves them unencoded. Note that spaces and tabs appearing at the end of lines are always encoded, as per RFC 1521. header is a flag which controls if spaces are encoded as underscores as per RFC 1522.

quopri.decodestring(s, header=False)

decode() bytes bytes

quopri.encodestring(s, quotetabs=False, header=False)

Like encode(), except that it accepts a source bytes and returns the corresponding encoded bytes. By default, it sends a False value to quotetabs parameter of the encode() function.

base64
MIME base64