For Gauche 0.9.14Search (procedure/syntax/module):

Next: , Previous: , Up: Library modules - Utilities   [Contents][Index]

12.52 rfc.quoted-printable - Quoted-printable encoding/decoding

Module: rfc.quoted-printable

This 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.

Function: quoted-printable-encode :key line-width binary

{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.

Function: quoted-printable-encode-message message :key line-width binary

{rfc.quoted-printable} Converts content of message, which can be either a string or a u8vector, to a string of Quoted-printable encoded format.

The keyword arguments are the same as quoted-printable-encode.

Function: quoted-printable-decode

{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.

Function: quoted-printable-decode-string-to target string

{rfc.quoted-printable} Decodes a Quoted-printable encoded string string, and returns the result as an instance of target, which must be either <string> or <u8vector>.

Function: quoted-printable-encode-string string :key line-width binary

{rfc.quoted-printable} Deprecated. This is for the backward compatibility. Use quoted-printable-encode-message instead.

Function: quoted-printable-decode-string string

{rfc.quoted-printable} Deprecated. This is for the backward compatibility. It is same as (quoted-printable-decode-string-to <string> string).


Next: , Previous: , Up: Library modules - Utilities   [Contents][Index]


For Gauche 0.9.14Search (procedure/syntax/module):