▼ |  | Net: Networking Libraries

1 | HTTP Client
2 | URLs and HTTP
3 | URI Codec: Encoding and Decoding URIs
4 | FTP: Client
5 | Send URL: Opening a Web Browser
6 | SMTP: Sending E-Mail
7 | sendmail: Sending E-Mail
8 | Headers: Parsing and Constructing
9 | Header Field Encoding
10 | IMAP: Reading Mail
11 | POP3: Reading Mail
12 | MIME: Decoding Internet Data
13 | Base 64: Encoding and Decoding
14 | Quoted-Printable: Encoding and Decoding
15 | DNS: Domain Name Service Queries
16 | NNTP: Newsgroup Protocol
17 | TCP: Unit and Signature
18 | TCP Redirect: tcp^ via Channels
19 | SSL Unit: tcp^ via SSL
20 | CGI Scripts
21 | Cookie: Legacy HTTP Client Storage
22 | Git Repository Checkout
| Bibliography
| Index

► | 14 | Quoted-Printable: Encoding and Decoding

14.1 | Functions
14.2 | Exceptions
14.3 | Quoted-Printable Unit
14.4 | -Printable Signature

On this page:

14.1`` Functions
qp-encode
qp-decode
qp-encode-stream
qp-decode-stream
14.2`` Exceptions
qp-error
qp-wrong-input
qp-wrong-line-size
14.3`` Quoted-Printable Unit
qp@
14.4`` -Printable Signature
qp^

top ← prev up next →

### 14`` Quoted-Printable: Encoding and Decoding

(require net/qp) | package: net-lib

The net/qp library provides utilities for quoted-printable (mime-standard) encoding and decoding from RFC 2045 section 6.7.
The library was written by Francisco Solsona.

#### 14.1`` Functions

> procedure (qp-encode bstr) → bytes?
> bstr : bytes?

Consumes a byte string and returns its quoted printable representation as a new string. The encoded string uses #"\r\n" where necessary to create shorter lines.

> procedure (qp-decode bstr) → bytes?
> bstr : bytes?

Consumes a byte string and returns its un-quoted printable representation as a new string. Non-soft line breaks are preserved in whatever form they exist (CR, LR, or CRLF) in the input string.

> procedure (qp-encode-stream in out [newline-bstr]) → void?
> in : input-port?
> out : output-port?
> newline-bstr : bytes? = #"\n"

Reads characters from in and writes the quoted printable encoded result to out.

The newline-bstr argument is used for soft line-breaks (after =). Note that the default newline-bstr is just #"\n", not #"\r\n".

Other line breaks are preserved in whatever form they exist (CR, LR, or CRLF) in the input stream.

> procedure (qp-decode-stream in out) → void?
> in : input-port?
> out : output-port?

Reads characters from in and writes de-quoted-printable result to out. Non-soft line breaks are preserved in whatever form they exist (CR, LR, or CRLF) in the input stream.

#### 14.2`` Exceptions

> > struct
> > (struct |  | qp-error ()
> #:extra-constructor-name make-qp-error)
> > struct
> > (struct |  | qp-wrong-input qp-error ()
> #:extra-constructor-name make-qp-wrong-input)
> > struct
> > (struct |  | qp-wrong-line-size qp-error ()
> #:extra-constructor-name make-qp-wrong-line-size)

None of these are used anymore, but the bindings are preserved for backward compatibility.

#### 14.3`` Quoted-Printable Unit

> > > qp@ and qp^ are deprecated. They exist for backward-compatibility and will likely be removed in the future. New code should use the net/qp module.

(require net/qp-unit) | package: compatibility-lib

> value qp@ : unit?

Imports nothing, exports qp^.

#### 14.4`` -Printable Signature

(require net/qp-sig) | package: compatibility-lib

> signature qp^ : signature

Includes everything exported by the net/qp module.

top ← prev up next →