Back to top

CL-RFC2407

Implementation of the RFC 2407 encoding.

What is it

The RFC 2047 defines an encoding to allow for textual message bodies in character sets other than US-ASCII, among others.

The library defines two functions for de- and encoding according to the RFC 2047.

I also ported the encoding function to javascript. It is available in Klatschbase beginning with version 0.5.

Documentation

The package export three functions: decode, decode*, and encode.

(encode (str &optional &key (encoding :b) (charset :utf-8))) encodes the given string with the given encoding (b or q) and charset.

(decode (str &key (start 0) (end (length str)))) decodes the given string, or parts thereof if start and end are defined.

(decode* (str &key (start 0) (end (length str)))) decodes a mixed string, i.e., not all words need to be encoded. This method detects the encoded parts.

Patches for Other Software

To enable RFC 2047 compliant behaviour in Hunchentoot you can apply this patch: hunchentoot-auth-rfc2047.patch (for version 0.15.6).

The javascript library jQuery leaves the authentication to the browser’s implementation of XMLHttpRequest. In case of firefox this results in credentials encoded in the URL. The patch jquery-1.2.5.httpauth.patch allows to put the credentials into the HTTP header and use RFC 2047 compliant encoding, by setting the AJAX option authheader to true. However, this patch requires webtoolkit’s base64 and rfc2047.js.

Download