💾 Archived View for tris.fyi › pydoc › quopri captured on 2022-01-08 at 13:42:10. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Conversions to/from quoted-printable transport encoding as per RFC 1521.
a2b_qp(data, header=False) Decode a string of qp-encoded data.
b2a_qp(data, quotetabs=False, istext=True, header=False) Encode a string using quoted-printable encoding. On encoding, when istext is set, newlines are not encoded, and white space at end of lines is. When istext is not set, \r and \n (CR/LF) are both encoded. When quotetabs is set, space and tabs are encoded.
decode(input, output, header=False) Read 'input', apply quoted-printable decoding, and write to 'output'. 'input' and 'output' are binary file objects. If 'header' is true, decode underscore as space (per RFC 1522).
decodestring(s, header=False)
encode(input, output, quotetabs, header=False) Read 'input', apply quoted-printable encoding, and write to 'output'. 'input' and 'output' are binary file objects. The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs and spaces are always encoded, as per RFC 1521. The 'header' flag indicates whether we are encoding spaces as _ as per RFC 1522.
encodestring(s, quotetabs=False, header=False)
ishex(c) Return true if the byte ordinal 'c' is a hexadecimal digit in ASCII.
main()
needsquoting(c, quotetabs, header) Decide whether a particular byte ordinal needs to be quoted. The 'quotetabs' flag indicates whether embedded tabs and spaces should be quoted. Note that line-ending tabs and spaces are always encoded, as per RFC 1521.
quote(c) Quote a single character.
unhex(s) Get the integer value of a hexadecimal number.
EMPTYSTRING = b''
ESCAPE = b'='
HEX = b'0123456789ABCDEF'
MAXLINESIZE = 76