Path: blob/master/test/jdk/java/util/Base64/plain.txt
41149 views
This test data is part of rfc2045 which includes all characters a~z A~Z, 0~9 and all symbols,1It is used to test java.util.Base64.Encoder, and will be encoded by org.apache.commons.codec.binary.Base64.java2to test java.util.Base64.Decoder;34Freed & Borenstein Standards Track [Page 1]5RFC 2045 Internet Message Bodies November 199667These documents are revisions of RFCs 1521, 1522, and 1590, which8themselves were revisions of RFCs 1341 and 1342. An appendix in RFC92049 describes differences and changes from previous versions.1011Table of Contents12131. Introduction ......................................... 3142. Definitions, Conventions, and Generic BNF Grammar .... 5153. MIME Header Fields ................................... 8164. MIME-Version Header Field ............................ 8175. Content-Type Header Field ............................ 10186. Content-Transfer-Encoding Header Field ............... 14197. Content-ID Header Field .............................. 26208. Content-Description Header Field ..................... 27219. Additional MIME Header Fields ........................ 272210. Summary ............................................. 272311. Security Considerations ............................. 272412. Authors' Addresses .................................. 2825A. Collected Grammar .................................... 292627Freed & Borenstein Standards Track [Page 7]28RFC 2045 Internet Message Bodies November 199629303. MIME Header Fields3132MIME defines a number of new RFC 822 header fields that are used to33describe the content of a MIME entity. These header fields occur in34at least two contexts:3536(1) As part of a regular RFC 822 message header.3738(2) In a MIME body part header within a multipart39construct.4041The formal definition of these header fields is as follows:4243MIME-message-headers := entity-headers44fields45version CRLF46; The ordering of the header47; fields implied by this BNF48; definition should be ignored.4950MIME-part-headers := entity-headers51[ fields ]52; Any field not beginning with53; "content-" can have no defined54; meaning and may be ignored.55; The ordering of the header56; fields implied by this BNF57; definition should be ignored.5859The syntax of the various specific MIME header fields will be60described in the following sections.6162Freed & Borenstein Standards Track [Page 11]63RFC 2045 Internet Message Bodies November 199664655.1. Syntax of the Content-Type Header Field6667In the Augmented BNF notation of RFC 822, a Content-Type header field68value is defined as follows:6970content := "Content-Type" ":" type "/" subtype71*(";" parameter)72; Matching of media type and subtype73; is ALWAYS case-insensitive.7475type := discrete-type / composite-type7677discrete-type := "text" / "image" / "audio" / "video" /78"application" / extension-token7980composite-type := "message" / "multipart" / extension-token8182extension-token := ietf-token / x-token8384ietf-token := <An extension token defined by a85standards-track RFC and registered86with IANA.>8788x-token := <The two characters "X-" or "x-" followed, with89no intervening white space, by any token>9091subtype := extension-token / iana-token9293iana-token := <A publicly-defined extension token. Tokens94of this form must be registered with IANA95as specified in RFC 2048.>9697parameter := attribute "=" value9899attribute := token100; Matching of attributes101; is ALWAYS case-insensitive.102103value := token / quoted-string104105token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,106or tspecials>107108tspecials := "(" / ")" / "<" / ">" / "@" /109"," / ";" / ":" / "\" / <">110"/" / "[" / "]" / "?" / "="111; Must be in quoted-string,112; to use within parameter values113114description := "Content-Description" ":" *text115116encoding := "Content-Transfer-Encoding" ":" mechanism117118entity-headers := [ content CRLF ]119[ encoding CRLF ]120[ id CRLF ]121[ description CRLF ]122*( MIME-extension-field CRLF )123124hex-octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F")125; Octet must be used for characters > 127, =,126; SPACEs or TABs at the ends of lines, and is127; recommended for any character not listed in128; RFC 2049 as "mail-safe".129130RFC 2045 Internet Message Bodies November 1996131132must be used. An equal sign as the last character on a133encoded line indicates such a non-significant ("soft")134line break in the encoded text.135136Thus if the "raw" form of the line is a single unencoded line that137says:138139Now's the time for all folk to come to the aid of their country.140141This can be represented, in the Quoted-Printable encoding, as:142143Now's the time =144for all folk to come=145to the aid of their country.146147Since the hyphen character ("-") may be represented as itself in the148Quoted-Printable encoding, care must be taken, when encapsulating a149quoted-printable encoded body inside one or more multipart entities,150to ensure that the boundary delimiter does not appear anywhere in the151encoded body. (A good strategy is to choose a boundary that includes152a character sequence such as "=_" which can never appear in a153quoted-printable body. See the definition of multipart messages in154RFC 2046.)155156!"#$@[\]^`{|}~%157158Freed & Borenstein Standards Track [Page 24]159160RFC 2045 Internet Message Bodies November 1996161162163Table 1: The Base64 Alphabet164165Value Encoding Value Encoding Value Encoding Value Encoding1660 A 17 R 34 i 51 z1671 B 18 S 35 j 52 01682 C 19 T 36 k 53 11693 D 20 U 37 l 54 21704 E 21 V 38 m 55 31715 F 22 W 39 n 56 41726 G 23 X 40 o 57 51737 H 24 Y 41 p 58 61748 I 25 Z 42 q 59 71759 J 26 a 43 r 60 817610 K 27 b 44 s 61 917711 L 28 c 45 t 62 +17812 M 29 d 46 u 63 /17913 N 30 e 47 v18014 O 31 f 48 w (pad) =18115 P 32 g 49 x18216 Q 33 h 50 y183184185