2. encoded-words の構文
"encoded-word" は以下の ABNF 文法で定義される。RFC 822 の表記法を使用するが、encoded-word の構成要素の間に空白文字が現れてはならない (MAY NOT) 点が例外である。
encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
charset = token ; see section 3
encoding = token ; see section 4
token = 1*<Any CHAR except SPACE, CTLs, and especials>
especials = "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "
<"> / "/" / "[" / "]" / "?" / "." / "="
encoded-text = 1*<Any printable ASCII character other
than "?" or SPACE>
; (but see "Use of encoded-words in message
; headers", section 5)
"encoding" 名と "charset" 名は大文字と小文字を区別しない。したがって、charset 名 "ISO-8859-1" は "iso-8859-1" と等価であり、"Q" という名前のエンコーディングは "Q" でも "q" でも表記できる。
encoded-word の長さは、charset、encoding、encoded-text、および区切り文字を含めて 75 文字を超えてはならない。75 文字の encoded-word に収まるよりも多くのテキストをエンコードする必要がある場合は、複数の encoded-word (CRLF SPACE で区切る) を使用してもよい。
複数行にわたるヘッダーフィールドの長さには制限がないが、1 つ以上の encoded-word を含むヘッダーフィールドの各行は 76 文字に制限される。
これらの長さの制限は、ネットワーク間のメールゲートウェイを通過する際の相互運用性を容易にするだけでなく、ヘッダーパーサーがトークンが encoded-word なのかそれ以外なのかを判断する前に用いなければならない先読み量 (最終的な ?= 区切り文字を探す際の先読み量) に上限を設けるためのものである。
encoded-text に現れる文字は、セクション 5 の規則によってさらに制限される。