⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc1522.txt

📁 <VC++网络游戏建摸与实现>源代码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
Network Working Group                                           K. MooreRequest for Comments: 1522                       University of TennesseeObsoletes: 1342                                           September 1993Category: Standards Track         MIME (Multipurpose Internet Mail Extensions) Part Two:              Message Header Extensions for Non-ASCII TextStatus of this Memo   This RFC specifies an Internet standards track protocol for the   Internet community, and requests discussion and suggestions for   improvements.  Please refer to the current edition of the "Internet   Official Protocol Standards" for the standardization state and status   of this protocol.  Distribution of this memo is unlimited.Abstract   This memo describes an extension to the message format defined in RFC   1521 [1], to allow the representation of character sets other than   ASCII in RFC 822 (STD 11) message headers.  The extensions described   were designed to be highly compatible with existing Internet mail   handling software, and to be easily implemented in mail readers that   support RFC 1521.1. Introduction   RFC 1521 describes a mechanism for denoting textual body parts which   are coded in various character sets, as well as methods for encoding   such body parts as sequences of printable ASCII characters.  This   memo describes similar techniques to allow the encoding of non-ASCII   text in various portions of a RFC 822 [2] message header, in a manner   which is unlikely to confuse existing message handling software.   Like the encoding techniques described in RFC 1521, the techniques   outlined here were designed to allow the use of non-ASCII characters   in message headers in a way which is unlikely to be disturbed by the   quirks of existing Internet mail handling programs.  In particular,   some mail relaying programs are known to (a) delete some message   header fields while retaining others, (b) rearrange the order of   addresses in To or Cc fields, (c) rearrange the (vertical) order of   header fields, and/or (d) "wrap" message headers at different places   than those in the original message.  In addition, some mail reading   programs are known to have difficulty correctly parsing message   headers which, while legal according to RFC 822, make use of   backslash-quoting to "hide" special characters such as "<", ",", or   ":", or which exploit other infrequently-used features of thatMoore                                                           [Page 1]RFC 1522                     MIME Part Two                September 1993   specification.   While it is unfortunate that these programs do not correctly   interpret RFC 822 headers, to "break" these programs would cause   severe operational problems for the Internet mail system.  The   extensions described in this memo therefore do not rely on little-   used features of RFC 822.   Instead, certain sequences of "ordinary" printable ASCII characters   (known as "encoded-words") are reserved for use as encoded data.  The   syntax of encoded-words is such that they are unlikely to   "accidentally" appear as normal text in message headers.   Furthermore, the characters used in encoded-words are restricted to   those which do not have special meanings in the context in which the   encoded-word appears.   Generally, an "encoded-word" is a sequence of printable ASCII   characters that begins with "=?", ends with "?=", and has two "?"s in   between.  It specifies a character set and an encoding method, and   also includes the original text encoded as graphic ASCII characters,   according to the rules for that encoding method.   A mail composer that implements this specification will provide a   means of inputting non-ASCII text in header fields, but will   translate these fields (or appropriate portions of these fields) into   encoded-words before inserting them into the message header.   A mail reader that implements this specification will recognize   encoded-words when they appear in certain portions of the message   header.  Instead of displaying the encoded-word "as is", it will   reverse the encoding and display the original text in the designated   character set.   NOTES      This memo relies heavily on notation and terms defined STD 11, RFC      822 and RFC 1521.  In particular, the syntax for the ABNF used in      this memo is defined in STD 11, RFC 822, as well as many of the      terms used in the grammar for the header extensions defined here.      Successful implementation of this protocol extension requires      careful attention to the details of both STD 11, RFC 822 and RFC      1521.      When the term "ASCII" appears in this memo, it refers to the "7-      Bit American Standard Code for Information Interchange", ANSI      X3.4-1986.  The MIME charset name for this character set is "US-      ASCII".  When not specifically referring to the MIME charset name,      this document uses the term "ASCII", both for brevity and forMoore                                                           [Page 2]RFC 1522                     MIME Part Two                September 1993      consistency with STD 11, RFC 822.  However, implementors are      warned that the character set name must be spelled "US-ASCII" in      MIME message and body part headers.2. Syntax of encoded-words   An "encoded-word" is defined by the following ABNF grammar.  The   notation of RFC 822 is used, with the exception that white space   characters MAY NOT appear between components of an encoded-word.   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)   Both "encoding" and "charset" names are case-independent.  Thus the   charset name "ISO-8859-1" is equivalent to "iso-8859-1", and the   encoding named "Q" may be spelled either "Q" or "q".   An encoded-word may not be more than 75 characters long, including   charset, encoding, encoded-text, and delimiters.  If it is desirable   to encode more text than will fit in an encoded-word of 75   characters, multiple encoded-words (separated by CRLF SPACE) may be   used.   While there is no limit to the length of a multiple-line header   field, each line of a header field that contains one or more   encoded-words is limited to 76 characters.   The length restrictions are included not only to ease   interoperability through internetwork mail gateways, but also to   impose a limit on the amount of lookahead a header parser must employ   (while looking for a final ?= delimiter) before it can decide whether   a token is an encoded-word or something else.   The characters which may appear in encoded-text are further   restricted by the rules in section 5.Moore                                                           [Page 3]RFC 1522                     MIME Part Two                September 19933. Character sets   The "charset" portion of an encoded-word specifies the character set   associated with the unencoded text.  A charset can be any of the   character set names allowed in an RFC 1521 "charset" parameter of a   "text/plain" body part, or any character set name registered with   IANA for use with the MIME text/plain content-type [3].  (See section   7.1.1 of RFC 1521 for a list of charsets defined in that document).   Some character sets use code-switching techniques to switch between   "ASCII mode" and other modes.  If unencoded text in an encoded-word   contains control codes to switch out of ASCII mode, it must also   contain additional control codes such that ASCII mode is again   selected at the end of the encoded-word.  (This rule applies   separately to each encoded-word, including adjacent encoded-words   within a single header field.)   When there is a possibility of using more than one character set to   represent the text in an encoded-word, and in the absence of private   agreements between sender and recipients of a message, it is   recommended that members of the ISO-8859-* series be used in   preference to other character sets.4. Encodings   Initially, the legal values for "encoding" are "Q" and "B".  These   encodings are described below.  The "Q" encoding is recommended for   use when most of the characters to be encoded are in the ASCII   character set; otherwise, the "B" encoding should be used.   Nevertheless, a mail reader which claims to recognize encoded-words   MUST be able to accept either encoding for any character set which it   supports.   Only a subset of the printable ASCII characters may be used in   encoded-text.  Space and tab characters are not allowed, so that the   beginning and end of an encoded-word are obvious.  The "?" character   is used within an encoded-word to separate the various portions of   the encoded-word from one another, and thus cannot appear in the   encoded-text portion.  Other characters are also illegal in certain   contexts.  For example, an encoded-word in a "phrase" preceding an   address in a From header field may not contain any of the "specials"   defined in RFC 822.  Finally, certain other characters are disallowed   in some contexts, to ensure reliability for messages that pass   through internetwork mail gateways.   The "B" encoding automatically meets these requirements.  The "Q"   encoding allows a wide range of printable characters to be used in   non-critical locations in the message header (e.g., Subject), withMoore                                                           [Page 4]RFC 1522                     MIME Part Two                September 1993   fewer characters available for use in other locations.4.1. The "B" encoding   The "B" encoding is identical to the "BASE64" encoding defined by RFC   1521.4.2. The "Q" encoding   The "Q" encoding is similar to the "Quoted-Printable" content-   transfer-encoding defined in RFC 1521.  It is designed to allow text   containing mostly ASCII characters to be decipherable on an ASCII   terminal without decoding.   (1) Any 8-bit value may be represented by a "=" followed by two       hexadecimal digits.  For example, if the character set in use       were ISO-8859-1, the "=" character would thus be encoded as       "=3D", and a SPACE by "=20".  (Upper case should be used for       hexadecimal digits "A" through "F".)   (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be       represented as "_" (underscore, ASCII 95.).  (This character may       not pass through some internetwork mail gateways, but its use       will greatly enhance readability of "Q" encoded data with mail       readers that do not support this encoding.)  Note that the "_"       always represents hexadecimal 20, even if the SPACE character       occupies a different code position in the character set in use.   (3) 8-bit values which correspond to printable ASCII characters other       than "=", "?", "_" (underscore), and SPACE may be represented as       those characters.  (But see section 5 for restrictions.)5. Use of encoded-words in message headers   An encoded-word may appear in a message header or body part header   according to the following rules:   (1) An encoded-word may replace a "text" token (as defined by RFC       822) in any Subject or Comments header field, any extension       message header field, or any RFC 1521 body part field for which       the field body is defined as "*text".  An encoded-word may also       appear in any user-defined ("X-") message or body part header       field.       Ordinary ASCII text and encoded-words may appear together in the       same header field.  However, 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.Moore                                                           [Page 5]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -