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">
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:" />
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"> Encode::MIME::Header -- MIME 'B' and 'Q' header encoding
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
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>
34 <h1><a name=
"name">NAME
</a></h1>
35 <p>Encode::MIME::Header -- MIME 'B' and 'Q' header encoding
</p>
39 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
41 use Encode qw/encode decode/;
42 $utf8 = decode('MIME-Header', $header);
43 $header = encode('MIME-Header', $utf8);
</pre>
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>
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>
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
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
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>
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
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"> Encode::MIME::Header -- MIME 'B' and 'Q' header encoding
</span></strong></big>