Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libbase64.tex @ 27998:e27f58a50737 legacy-trunk
SF bug #690377: Dud footnote reference in distutils docs
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Fri, 21 Feb 2003 02:47:09 +0000 |
| parents | be54ba4b2c44 |
| children | a6bc131ab618 |
| rev | line source |
|---|---|
| 8918 | 1 \section{\module{base64} --- |
|
10255
0614e7f16741
More reasonable section titles.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
2 Encode and decode MIME base64 data} |
|
0614e7f16741
More reasonable section titles.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
3 |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8416
diff
changeset
|
4 \declaremodule{standard}{base64} |
|
10255
0614e7f16741
More reasonable section titles.
Fred Drake <fdrake@acm.org>
parents:
8918
diff
changeset
|
5 \modulesynopsis{Encode and decode files using the MIME base64 data.} |
|
8716
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8416
diff
changeset
|
6 |
|
760dcf197048
Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents:
8416
diff
changeset
|
7 |
|
7788
b1c091501411
Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents:
7277
diff
changeset
|
8 \indexii{base64}{encoding} |
|
b1c091501411
Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents:
7277
diff
changeset
|
9 \index{MIME!base64 encoding} |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 |
|
8416
9ea50031149c
Minor grammatical correction: "This module perform ..." --> "This module
Fred Drake <fdrake@acm.org>
parents:
7873
diff
changeset
|
11 This module performs base64 encoding and decoding of arbitrary binary |
|
18574
346dcafc878b
Minor changes to match the style guide.
Fred Drake <fdrake@acm.org>
parents:
17448
diff
changeset
|
12 strings into text strings that can be safely sent by email or included |
|
346dcafc878b
Minor changes to match the style guide.
Fred Drake <fdrake@acm.org>
parents:
17448
diff
changeset
|
13 as part of an HTTP POST request. The |
|
12223
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
14 encoding scheme is defined in \rfc{1521} (\emph{MIME |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
15 (Multipurpose Internet Mail Extensions) Part One: Mechanisms for |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
16 Specifying and Describing the Format of Internet Message Bodies}, |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
17 section 5.2, ``Base64 Content-Transfer-Encoding'') and is used for |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
18 MIME email and various other Internet-related applications; it is not |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
19 the same as the output produced by the \program{uuencode} program. |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
20 For example, the string \code{'www.python.org'} is encoded as the |
|
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
10718
diff
changeset
|
21 string \code{'d3d3LnB5dGhvbi5vcmc=\e n'}. |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 |
|
6689
84b43ff42fa8
Added \indexsubitem definition; functions were previously indexed for the
Fred Drake <fdrake@acm.org>
parents:
5818
diff
changeset
|
23 |
|
7034
ddf52f01bc0a
Fixed index entries to be more consistent.
Fred Drake <fdrake@acm.org>
parents:
6689
diff
changeset
|
24 \begin{funcdesc}{decode}{input, output} |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
25 Decode the contents of the \var{input} file and write the resulting |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
26 binary data to the \var{output} file. |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
27 \var{input} and \var{output} must either be file objects or objects that |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
28 mimic the file object interface. \var{input} will be read until |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
29 \code{\var{input}.read()} returns an empty string. |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
30 \end{funcdesc} |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
31 |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
32 \begin{funcdesc}{decodestring}{s} |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
33 Decode the string \var{s}, which must contain one or more lines of |
|
7788
b1c091501411
Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents:
7277
diff
changeset
|
34 base64 encoded data, and return a string containing the resulting |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
35 binary data. |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
36 \end{funcdesc} |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
37 |
|
7034
ddf52f01bc0a
Fixed index entries to be more consistent.
Fred Drake <fdrake@acm.org>
parents:
6689
diff
changeset
|
38 \begin{funcdesc}{encode}{input, output} |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
39 Encode the contents of the \var{input} file and write the resulting |
|
7788
b1c091501411
Be more specific about where in RFC 1421 to look, since it's not at all
Fred Drake <fdrake@acm.org>
parents:
7277
diff
changeset
|
40 base64 encoded data to the \var{output} file. |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
41 \var{input} and \var{output} must either be file objects or objects that |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
42 mimic the file object interface. \var{input} will be read until |
|
23464
be54ba4b2c44
Patch 547037. Corrected documentation to match
Raymond Hettinger <python@rcn.com>
parents:
21062
diff
changeset
|
43 \code{\var{input}.read()} returns an empty string. \function{encode()} |
|
be54ba4b2c44
Patch 547037. Corrected documentation to match
Raymond Hettinger <python@rcn.com>
parents:
21062
diff
changeset
|
44 returns the encoded data plus a trailing newline character |
|
be54ba4b2c44
Patch 547037. Corrected documentation to match
Raymond Hettinger <python@rcn.com>
parents:
21062
diff
changeset
|
45 (\code{'\e n'}). |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
46 \end{funcdesc} |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
47 |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
48 \begin{funcdesc}{encodestring}{s} |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
49 Encode the string \var{s}, which can contain arbitrary binary data, |
|
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
50 and return a string containing one or more lines of |
|
23464
be54ba4b2c44
Patch 547037. Corrected documentation to match
Raymond Hettinger <python@rcn.com>
parents:
21062
diff
changeset
|
51 base64-encoded data. \function{encodestring()} returns a |
|
be54ba4b2c44
Patch 547037. Corrected documentation to match
Raymond Hettinger <python@rcn.com>
parents:
21062
diff
changeset
|
52 string containing one or more lines of base64-encoded data |
|
be54ba4b2c44
Patch 547037. Corrected documentation to match
Raymond Hettinger <python@rcn.com>
parents:
21062
diff
changeset
|
53 always including an extra trailing newline (\code{'\e n'}). |
|
5344
9ca27188da23
Added fnmatch, base64 and quopri, received from Andrew Kuchling.
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
54 \end{funcdesc} |
|
10718
fe1e98190af6
Added "See also" sections linking to binascii.
Fred Drake <fdrake@acm.org>
parents:
10255
diff
changeset
|
55 |
|
fe1e98190af6
Added "See also" sections linking to binascii.
Fred Drake <fdrake@acm.org>
parents:
10255
diff
changeset
|
56 \begin{seealso} |
|
21062
bc02c3b09626
Clean up some markup cruft. A number of the macros that take no
Fred Drake <fdrake@acm.org>
parents:
20144
diff
changeset
|
57 \seemodule{binascii}{Support module containing \ASCII-to-binary |
|
15261
bc4f89eefb04
Make all the \seemodule explanations consistent: start with a capitalized
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
58 and binary-to-\ASCII{} conversions.} |
|
17448
45c1825196ed
Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents:
15261
diff
changeset
|
59 \seerfc{1521}{MIME (Multipurpose Internet Mail Extensions) Part One: |
|
45c1825196ed
Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents:
15261
diff
changeset
|
60 Mechanisms for Specifying and Describing the Format of |
|
45c1825196ed
Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents:
15261
diff
changeset
|
61 Internet Message Bodies}{Section 5.2, ``Base64 |
|
45c1825196ed
Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents:
15261
diff
changeset
|
62 Content-Transfer-Encoding,'' provides the definition of the |
|
45c1825196ed
Convert several \seetext references to \seerfc and \seetitle versions.
Fred Drake <fdrake@acm.org>
parents:
15261
diff
changeset
|
63 base64 encoding.} |
|
10718
fe1e98190af6
Added "See also" sections linking to binascii.
Fred Drake <fdrake@acm.org>
parents:
10255
diff
changeset
|
64 \end{seealso} |
