Install Perl 5.8.8
[msysgit.git] / mingw / html / ext / Encode / lib / Encode / MIME / Header.html
blobc431a9b6fc24640915a012bb1e2ab284f3d3f8b4
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>Encode::MIME::Header -- MIME 'B' and 'Q' header encoding</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;Encode::MIME::Header -- MIME 'B' and 'Q' header encoding</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#abstract">ABSTRACT</a></li>
25 <li><a href="#description">DESCRIPTION</a></li>
26 <li><a href="#bugs">BUGS</a></li>
27 <li><a href="#see_also">SEE ALSO</a></li>
28 </ul>
29 <!-- INDEX END -->
31 <hr />
32 <p>
33 </p>
34 <h1><a name="name">NAME</a></h1>
35 <p>Encode::MIME::Header -- MIME 'B' and 'Q' header encoding</p>
36 <p>
37 </p>
38 <hr />
39 <h1><a name="synopsis">SYNOPSIS</a></h1>
40 <pre>
41 use Encode qw/encode decode/;
42 $utf8 = decode('MIME-Header', $header);
43 $header = encode('MIME-Header', $utf8);</pre>
44 <p>
45 </p>
46 <hr />
47 <h1><a name="abstract">ABSTRACT</a></h1>
48 <p>This module implements RFC 2047 Mime Header Encoding. There are 3
49 variant encoding names; <code>MIME-Header</code>, <code>MIME-B</code> and <code>MIME-Q</code>. The
50 difference is described below</p>
51 <pre>
52 decode() encode()
53 ----------------------------------------------
54 MIME-Header Both B and Q =?UTF-8?B?....?=
55 MIME-B B only; Q croaks =?UTF-8?B?....?=
56 MIME-Q Q only; B croaks =?UTF-8?Q?....?=</pre>
57 <p>
58 </p>
59 <hr />
60 <h1><a name="description">DESCRIPTION</a></h1>
61 <p>When you decode(=?<em>encoding</em>?<em>X</em>?<em>ENCODED WORD</em>?=), <em>ENCODED WORD</em>
62 is extracted and decoded for <em>X</em> encoding (B for Base64, Q for
63 Quoted-Printable). Then the decoded chunk is fed to
64 decode(<em>encoding</em>). So long as <em>encoding</em> is supported by Encode,
65 any source encoding is fine.</p>
66 <p>When you encode, it just encodes UTF-8 string with <em>X</em> encoding then
67 quoted with =?UTF-8?<em>X</em>?....?= . The parts that RFC 2047 forbids to
68 encode are left as is and long lines are folded within 76 bytes per
69 line.</p>
70 <p>
71 </p>
72 <hr />
73 <h1><a name="bugs">BUGS</a></h1>
74 <p>It would be nice to support encoding to non-UTF8, such as =?ISO-2022-JP?
75 and =?ISO-8859-1?= but that makes the implementation too complicated.
76 These days major mail agents all support =?UTF-8? so I think it is
77 just good enough.</p>
78 <p>Due to popular demand, 'MIME-Header-ISO_2022_JP' was introduced by
79 Makamaka. Thre are still too many MUAs especially cellular phone
80 handsets which does not grok UTF-8.</p>
81 <p>
82 </p>
83 <hr />
84 <h1><a name="see_also">SEE ALSO</a></h1>
85 <p><a href="file://C|\msysgit\mingw\html/lib/Encode.html">the Encode manpage</a></p>
86 <p>RFC 2047, <a href="http://www.faqs.org/rfcs/rfc2047.html">http://www.faqs.org/rfcs/rfc2047.html</a> and many other
87 locations.</p>
88 <table border="0" width="100%" cellspacing="0" cellpadding="3">
89 <tr><td class="block" style="background-color: #cccccc" valign="middle">
90 <big><strong><span class="block">&nbsp;Encode::MIME::Header -- MIME 'B' and 'Q' header encoding</span></strong></big>
91 </td></tr>
92 </table>
94 </body>
96 </html>