Quoted-printable
Quoted-printable
Main page

Quoted-printable

logo
Community Hub0 subscribers
What are your thoughts?
Be the first to start a discussion here.
Be the first to start a discussion here.
Quoted-printable

The Quoted-Printable encoding is an escape syntax that uses printable ASCII characters (alphanumeric and the equals sign =) to represent arbitrary binary data to enable transmission of 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. Historically, because of the wide range of systems and protocols that could be used to transfer messages, e-mail was often assumed to be non-8-bit-clean – however, modern SMTP servers are in most cases 8-bit clean and support the 8BITMIME extension. It can also be used with data that contains non-permitted octets or line lengths exceeding SMTP limits. It is defined as a MIME content transfer encoding for use in e-mail.

The Quoted-Printable encoding works by using the equals sign = as an escape character. It also limits line length to 76, as some software has limits on line length.

MIME defines mechanisms for sending other kinds of information in e-mail, including text in languages other than English, using character encodings other than ASCII. However, these encodings often use byte values outside the ASCII range so they need to be encoded further before they are suitable for use in a non-8-bit-clean environment. The Quoted-Printable encoding is one method used for mapping arbitrary bytes into sequences of ASCII characters. So, Quoted-Printable is not a character encoding scheme itself, but a data coding layer to be used under some byte-oriented character encoding. The Quoted-Printable encoding is reversible, meaning the original bytes and hence the non-ASCII characters they represent can be identically recovered.

Quoted-Printable and Base64 are the two MIME content transfer encodings, if the trivial "7bit" and "8bit" encoding are not counted. If the text to be encoded does not contain many non-ASCII characters, then Quoted-Printable results in a fairly readable and compact encoded result. On the other hand, if the input has many 8-bit characters, then Quoted-Printable becomes both unreadable and extremely inefficient. Base64 is not human-readable, but has a uniform overhead for all data and is the more sensible choice for binary formats or text in a script other than the Latin script.

Any 8-bit byte value may be encoded with 3 characters: an = followed by two hexadecimal digits (0–9 or A–F) representing the byte's numeric value. For example, an ASCII form feed character (decimal value 12) can be represented by =0C, and an ASCII equal sign (decimal value 61) must be represented by =3D. All characters except printable ASCII characters or end of line characters (but also =) must be encoded in this fashion.

All printable ASCII characters (decimal values between 33 and 126) may be represented by themselves, except = (decimal 61, hexadecimal 3D, therefore =3D).

ASCII tab and space characters, decimal values 9 and 32, may be represented by themselves, except if these characters would appear at the end of the encoded line. In that case, they would need to be escaped as =09 (tab) or =20 (space), or be followed by a = (soft line break) as the last character of the encoded line. This last solution is valid because it prevents the tab or space from being the last character of the encoded line.

If the data being encoded contains meaningful line breaks, they must be encoded as an ASCII CR LF sequence, not as their original byte values, neither directly nor via = signs. Conversely, if byte values 13 and 10 have meanings other than end of line (in media types, for example), then they must be encoded as =0D and =0A respectively.

See all
User Avatar
No comments yet.