MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text
This particular document is the third document in the series. It describes extensions to RFC 822 to allow non-US-ASCII text data in Internet mail header fields. [STANDARDS-TRACK]
Replaces RFC 1341: MIME (Multipurpose Internet Mail Extensions): Mechanisms for Specifying and Describing the Format of Internet Message Bodies, RFC 1342: Representation of Non-ASCII Text in Internet Message Headers, RFC 1521: MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies, RFC 1522: MIME (Multipurpose Internet Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text, RFC 1590: Media Type Registration Procedure.
This document is current and has been amended. 2 later RFCs have changed part of it. Nothing on the RFC itself tells you this.
Normative requirements
Every sentence in this RFC carrying an RFC 2119 keyword, with the section it came from. 18 must, 0 should, 2 may.
2 Syntax of encoded-words
- MUST NOTThe notation of RFC 822 is used, with the exception that white space characters MUST NOT appear between components of an 'encoded-word'.
3 Character sets
- MUSTIf unencoded text in an 'encoded-word' contains a sequence which causes the charset interpreter to switch out of ASCII mode, it MUST contain additional control codes such that ASCII mode is again selected at the end of the 'encoded-word'.
4 Encodings
- MUSTNevertheless, a mail reader which claims to recognize 'encoded-word's MUST be able to accept either encoding for any character set which it supports.
4.2 The "Q" encoding
- MAY(3) 8-bit values which correspond to printable ASCII characters other than "=", "?", and "_" (underscore), MAY be represented as those characters.
- MUST NOT(But see section 5 for restrictions.) In particular, SPACE and TAB MUST NOT be represented as themselves within encoded words.
5 Use of encoded-words in message headers
- MUSTHowever, an 'encoded-word' that appears in a header field defined as '*text' MUST be separated from any adjacent 'encoded-word' or 'text' by 'linear-white-space'.
- MUST NOTA "Q"-encoded 'encoded-word' which appears in a 'comment' MUST NOT contain the characters "(", ")" or " 'encoded-word' that appears in a 'comment' MUST be separated from any adjacent 'encoded-word' or 'ctext' by 'linear-white-space'.
- MUSTAn 'encoded-word' that appears within a 'phrase' MUST be separated from any adjacent 'word', 'text' or 'special' by 'linear-white-space'.
- MUST NOT+ An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'.
- MUST NOT+ An 'encoded-word' MUST NOT appear within a 'quoted-string'.
- MUST NOT+ An 'encoded-word' MUST NOT be used in a Received header field.
- MUST NOT+ An 'encoded-word' MUST NOT be used in parameter of a MIME Content-Type or Content-Disposition field, or in any structured field body except within a 'comment' or 'phrase'.
- MUST NOTThe 'encoded-text' in an 'encoded-word' must be self-contained; 'encoded-text' MUST NOT be continued from one 'encoded-word' to another.
- MUSTEach 'encoded-word' MUST encode an integral number of octets.
- MUSTEach 'encoded-word' MUST represent an integral number of characters.
6.3 Mail reader handling of incorrectly formed 'encoded-word's
- MUST NOTHowever, a mail reader MUST NOT prevent the display or handling of a message because an 'encoded-word' is incorrectly formed.
7 Conformance
- MUSTA mail composing program claiming compliance with this specification MUST ensure that any string of non-white-space printable ASCII characters within a '*text' or '*ctext' that begins with "=?" and ends with "?=" be a valid 'encoded-word'.
8 Examples
- MUSTWithin a 'comment', white space MUST appear between an 'encoded-word' and surrounding text.
- MUSTIn order to cause a SPACE to be displayed within a portion of encoded text, the SPACE MUST be encoded as part of the 'encoded-word'.
- MAYIn order to cause a SPACE to be displayed between two strings of encoded text, the SPACE MAY be encoded as part of one of the 'encoded-word's.