Next: SHA message digest, Previous: MIME message handling, Up: Library modules - Utilities [Contents][Index]
rfc.quoted-printable
- Quoted-printable encoding/decodingThis module defines a few functions to encode/decode Quoted-printable format, defined in RFC 2045 (https://www.ietf.org/rfc/rfc2045.txt), section 6.7.
{rfc.quoted-printable}
Reads byte stream from the current input port, encodes it in Quoted-printable
format and writes the result character stream to the current output port.
The conversion ends when it reads EOF from the current input port.
The keyword argument line-width specifies the maximum
line width of the generated output in characters. If the encoded
output creates a long line, the procedure inserts a “soft line break”
so that the each line is equal to or shorter than this number.
Soft line breaks are removed when quoted-printable text is
decoded.
The default line width is 76. (The minimum meaningful number of
line-width is 4). You can suppress soft line breaks by
giving #f
or 0
to line-width.
By default, quoted-printable-encode
generates CR-LF
sequence
for each line break in the input (“hard line break”).
When a true value is given to the keyword argument binary,
however, octets #x0a
and #x0d
in the input are encoded
as =0A
and =0D
, respectively. See RFC2045 section 6.7
for the details.
{rfc.quoted-printable} Converts contents of string to Quoted-printable encoded format. Input string can be either complete or incomplete string; it is always interpreted as a byte sequence.
The keyword arguments are the same as quoted-printable-encode
.
{rfc.quoted-printable} Reads character stream from the current input port, decodes it from Quoted-printable format and writes the result byte stream to the current output port. The conversion ends when it reads EOF. If it encounters illegal character sequence (such as ’=’ followed by non-hexadecimal characters), it copies them literally to the output.
{rfc.quoted-printable} Decodes a Quoted-printable encoded string string and returns the result as a string.
Next: SHA message digest, Previous: MIME message handling, Up: Library modules - Utilities [Contents][Index]