Quoted-Printable
Quoted-Printable is a MIME content transfer encoding for mostly-ASCII text: only non-printable characters are escaped as =HH, keeping most of the text readable.
Purpose
When text is mostly ASCII with only a few non-ASCII characters, it expands far less than Base64 and stays human-readable.
Mechanism
Printable ASCII (33-126, except =) passes through unchanged; every other byte becomes = followed by two uppercase hexadecimal digits. Line endings use = soft line breaks (encoded lines stay within 76 characters), and spaces or tabs at the end of a line must also be escaped.
Use cases
- Email bodies in Chinese and European languages
- vCard contact field encoding
- MIME header parameter values
- SMTP UTF-8 fallback
Examples
- Input
caféOutputcaf=C3=A9é (U+00E9) encodes to UTF-8 bytes C3 A9, escaped as =C3=A9
Common errors
- Unescaped trailing spaces being lost during decoding
- Strictly follow RFC 2045: escape trailing spaces as =20 and tabs as =09
Related terms
MIME Encoding
MIME (Multipurpose Internet Mail Extensions) encoding defines the mechanisms for transporting non-ASCII text and binary attachments in email, including the Base64 and Quoted-Printable content transfer encodings. GLOSSARY
Base64
Base64 maps arbitrary binary data onto 64 printable ASCII characters (A-Z, a-z, 0-9, +, /) so that binary data can travel over text-only channels. GLOSSARY
Charset
A character set (charset) is the mapping table from characters to code points; together with an encoding form (such as UTF-8) it determines how text becomes a byte stream. GLOSSARY