/[suikacvs]/messaging/manakai/doc/introduction.ja.html
Suika

Contents of /messaging/manakai/doc/introduction.ja.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download) (as text)
Fri Jun 14 12:46:34 2002 UTC (22 years, 4 months ago) by wakaba
Branch: MAIN
Changes since 1.5: +73 -40 lines
File MIME type: text/html
*** empty log message ***

1 wakaba 1.5 <?xml version="1.0" encoding="iso-2022-jp"?>
2 wakaba 1.6 <?xml-stylesheet href="/s/simpledoc.css" type="text/css" ?>
3 wakaba 1.5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
4     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
5     <html xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml">
6     <head>
7     <title xml:lang="en">Message::* Perl modules</title>
8     <link rel="index" href="./" />
9 wakaba 1.6 <link rel="stylesheet" href="/s/simpledoc.css" type="text/css" />
10 wakaba 1.5 <link rev="made" href="mailto:w@suika.fam.cx" />
11     <link rel="copyright" href="/c/pd" title="Public Domain." />
12     <meta name="author" content="$B<cMU(B" />
13 wakaba 1.6 <meta name="keywords" content="Perl, module, pm, Message, RFC 822, RFC 2822, RFC 1036, son-of-RFC1036, MIME, Usefor, HTTP, CGI, header, field" />
14 wakaba 1.5 </head>
15     <body>
16     <h1>Message::* Perl modules</h1>
17    
18     <h2>$B$O$8$a$N$O$8$a$K(B</h2>
19    
20     <p>$B$?$H$($P(B Perl $B$G=q$+$l$?(B CGI script, $B$=$l$b7G<(HD$J$s$+$K$O!"(B
21 wakaba 1.6 $B$3$s$J$_$C$H$b$J$$(B code $B$,:\$C$F$$$?$j$7$^$9!#(B</p>
22 wakaba 1.5
23     <pre class="application-x-perl">
24     jcode'convert(*from, "jis");
25     jcode'convert(*subject, "jis");
26     jcode'convert(*message, "jis");
27     open (MAIL, "| $sendmail");
28     print MAIL "From: $mail ($from)\n";
29     print MAIL "To: $mailto\n";
30     print MAIL "Subject: $subject\n";
31     print MAIL "\n";
32     print MAIL "$message";
33     print MAIL "\n";
34     close (MAIL);
35     </pre>
36    
37     <p>$B$3$l$G$O;kG'@-$bNI$/$J$$$G$9$7!"$&$C$+$j=$@5$74V0c$($k$H(B
38     $BJQ$J%a%C%;!<%8$rAw?.$7$F$7$^$$$^$9!#(B
39     ($BI.<T$O$7$g$C$A$e$&$O$^$C$F$^$7$?(B:-)
40     ($B$=$l$KB?$/$N(B code $B$G$O!"(B
41     HTML $B$G$N%/%m%9%5%$%H%9%/%j%W%F%#%s%0(B (CSS) $BLdBj$H(B
42     $BN`;w$NLdBj$X$NBP=h$r$7$F$$$^$;$s!#(B)</p>
43    
44     <p>$B%*%V%8%'%/%H;X8~$r<h$jF~$l$F<!$N$h$&$J46$8$G%a%C%;!<%8$r(B
45     $B9=@.$7$?$$$H$3$m$G$9!#(B</p>
46    
47     <pre class="application-x-perl">
48     use Message::Entity;
49     my $msg = new Message::Entity;
50     my $hdr = $msg-&gt;header;
51     $hdr-&gt;add ('From')-&gt;add ('me@bar.example');
52 wakaba 1.6 $hdr-&gt;add ('To')-&gt;add (['foo@bar.example', display_name =&gt; 'Mr. foo']);
53     $hdr-&gt;add (Subject =&gt; $subject);
54 wakaba 1.5 $msg-&gt;body ($body);
55    
56     # $smtp-&gt;send $B$O(B SMTP $B$GAw?.$9$k(B method $B$H2>Dj!#(B
57     $smtp-&gt;send ($msg);
58     </pre>
59    
60     <p><a href="http://www.cpan.org/" xml:lang="en">CPAN</a> $B$rC5$9$H!"(B
61     $B$3$l$K;w$?$h$&$J$3$H$,$G$-$=$&$J%b%8%e!<%k$O$"$k$h$&$G$9$,!"(B
62     $B<B:]$K;H$C$F$_$k$H!"M?$($kCM$K$h$C$F$O(B <a href="urn:ietf:rfc:822">RFC 822</a>/<a href="urn:ietf:rfc:2822">2822</a> $B$K0cH?$9$k(B
63 wakaba 1.6 $B7k2L$r=PNO$9$k$H$+!"$=$b$=$b$=$l0JA0$K!"(B
64     <code>$hdr->addr ('Foo Bar &lt;foo@bar.example>')</code>
65     $B$N$h$&$K%a%C%;!<%87A<0$r%b%8%e!<%kFb$K1#F?$7$-$l$F$$$J$$$H$+!"Hs(B
66     ASCII $BJ8;z$r9MN8$7$F$$$J$$$H$+$NITK~$,$"$j$^$9!#(B</p>
67    
68     <p class="note">($B<BAuJ}?K$H$7$F$OIT@5$JCM$O%b%8%e!<%k$KEO$9A0$KCF$/$Y$-$H$$$&9M$(J}$b$"$k$G$7$g$&$1$I!"0lHLE*$JMxMQ$K:]$7$F$O8-$$@_7W$@$H$O;W$($^$;$s!#(B)</p>
69 wakaba 1.5
70     <p>$B$H$$$&$3$H$G!"$O$8$a$O4{B8$N%b%8%e!<%k$N(B wrapper ($B$"$k$$$OJd40(B)
71     $B$r=q$/$D$b$j$G$7$?$,!"$J$s$@$+$4$A$c$4$A$c$7$F$$$F!"(B
72     $B$=$l$J$i<VNX$N:FH/L@$K$J$C$F$b0l$+$i=q$$$F$_$h$&$H9M$($^$7$?!#(B</p>
73    
74     <h2>$BFC?'(B ($B$H$$$&Dx$N$b$N$G$b$J$$!#(B)</h2>
75    
76     <ol>
77 wakaba 1.6 <li>$B7k9=%*%V%8%'%/%H;X8~$G$9!#(B</li>
78 wakaba 1.5 <li>RFC 822/2822 $B$N(B <code class="bnf rfc2822">group</code> $B$r2r<a=PMh$^$9!#(B</li>
79     <li><a href="urn:ietf:id:draft-ietf-usefor-msg-id-alt-00">draft-ietf-usefor-msg-id-alt-00</a> $B$K4p$E$$$?Aw?.%"%I%l%9$J$I$K$h$k(B <code class="rfc2822">Message-ID</code> $B$r@8@.=PMh$^$9!#(B</li>
80     <li>$BJ8;z%3!<%IFHN)(B (CSI) $B$G$9!#(B ($BC"$7(B RFC 822 $B$G$"$kET9g>e(B($BFf(B)$B!"(B
81 wakaba 1.6 ASCII $B8_49$G$"$kI,MW$O$"$j$^$9!#(B EBCDIC $B$H$+$OL5M}$G$9(B:-&lt;
82     ($B$H$$$&$N$O%a%C%;!<%89=B$$NItJ,$N$3$H$G$9!#(B
83     MIME $B$r;H$C$F(B EBCDIC $B$J$I$r%a%C%;!<%8K\J8$KF~$l$k$3$H$O2DG=$G$9!#(B))</li>
84     <li>MIME (<a href="urn:ietf:rfc:2045">RFC 2045</a>,
85     <a href="urn:ietf:rfc:2046">2046</a>) $B$K$[$\40A4$KBP1~$7$F$$$^$9!#(B</li>
86 wakaba 1.5 </ol>
87    
88     <h2>$B3F;EMM$X$NBP1~>u67(B</h2>
89    
90     <ol>
91     <li>$BEE;R%a%$%k$N%a%C%;!<%8(B (RFC 822, RFC 2822)
92 wakaba 1.6 $B$NA45!G=$KBP1~$7$F$$$^$9!#(B</li>
93 wakaba 1.5 <li>$BEE;R%K%e!<%95-;v(B (<a href="/uri-res/N2L?urn:ietf:rfc:1036">RFC 1036</a>,
94     <a href="spec/son-of-RFC1036">son-of-RFC1036</a>,
95     <a href="/uri-res/N2L?urn:ietf:id:draft-usefor-article-06">
96     draft-usefor-article (06)</a>) $B$NF,NN0h$NB?$/$KBP1~$7$F$$$^$9!#(B</li>
97 wakaba 1.6 <li>MIME $B$NK\J8ItJ,(B (body part) $B$KBP1~$7$F$$$^$9!#(B
98     <ul>
99     <li>$BB?ItJ,(B (multipart) $B$dJ,3d(B (message/partial),
100     $B30ItK\J,(B (message/external-body) $B$r07$&$3$H$,=PMh$^$9!#(B</li>
101     <li>text/plain; format=flowed
102     (<a href="urn:ietf:rfc:2646">RFC 2646</a>)
103     $B$KBP1~$7$F$$$^$9!#(B</li>
104     <li>Content-Transfer-Encoding $B$O(B Base64, Quoted-Printable
105     $B$OL^O@!"(B x-uuencode, x-gzip64 $B$K$bBP1~!#(B
106     RFC 2822 $B%a%$%k=PNO%b!<%I$G$O!"K\J8$,(B8$B%S%C%H$G$b<+F0E*$KE,@Z$J(B
107     CTE $B$GId9f2=$7$^$9!#(B</li>
108     </ul>
109     </li>
110     <li>MIME $B$NF,NN0h(B
111 wakaba 1.5 (<a href="/uri-res/N2L?urn:ietf:rfc:2045">RFC 2045</a>,
112     <code class="mime">Content-Disposition</code>) $B$KBP1~$7$F$$$^$9!#(B
113     $B%Q%i%a!<%?!<CM3HD%(B (<a href="/uri-res/N2L?urn:ietf:rfc:2231">RFC 2231</a>)
114     $B$bF~=PNO$H$b$K<BAu$7$^$7$?!#(B</li>
115     <li>MIME $BId9f2=8l(B (<code class="mime bnf">encoded-word</code>)
116 wakaba 1.6 $B$N2rFI$KBP1~$7$F$$$^$9(B:-)</li>
117 wakaba 1.5 <li>HTTP/1.0, HTTP/1.1, CGI/1.1, CGI/1.2 $B$NF,NN0h$N$&$A!"(B
118     $B$4$/0lIt$KBP1~$7$F$$$^$9!#(B MHTML $B$N(B
119     <code class="mime">Content-Location</code> $B$K$bBP1~$7$F$$$^$9!#(B</li>
120     <li>$BF|IU7A<0$G$O(B RFC 822/<a href="urn:ietf:rfc:1123">1123</a>,
121     <a href="urn:ietf:rfc:733">RFC 733</a>, asctime, ISO 8601 (HTML)
122 wakaba 1.6 $B$J$I$KBP1~$7$F$$$^$9!#F|IU$N=PNO$O(B sprintf
123     $B$NMM$J=q<0J8;zNs$rM?$($k$3$H$G!"B?<oB?MM$J7A<0$KBP1~!#(B</li>
124     <li>X-Moe $B%7%j!<%:$KBP1~$7$F$$$^$9(B:-)</li>
125 wakaba 1.5 </ol>
126    
127     <h2>$B@)8B;v9`(B</h2>
128    
129     <ol>
130     <li>$BN`;w%b%8%e!<%k(B($BFf(B)$B$N$h$&$K!"%U%!%$%kL>$d%U%!%$%k!&%O%s%I%k$r(B
131     $BEO$7$FFI$_9~$^$;$k$3$H$,=PMh$^$;$s!#(B</li>
132     <li>$BBg$-$J%a%C%;!<%8$G$b0l5$$KFI$_9~$_!"A4$F<g5-21NN0h$G(B
133     $BJ];}$7$F$$$^$9!#$G$9$+$i$"$^$jBg$-$J%a%C%;!<%8$N=hM}$K$O(B
134     $B8~$$$F$$$J$$$G$7$g$&!#(B</li>
135     <li><code>CR</code> $B$d(B <code>LF</code> $B$,C1BN$G=P8=$9$k>l9g!"(B
136 wakaba 1.6 $B@5$7$/=hM}=PMh(B<del>$B$^$;$s(B</del><ins>$B$J$$$3$H$,$"$j$^$9(B
137     ($B6a$$>-Mh$NHG$G2~A1$NM=Dj(B)</ins>$B!#(B (<code>CRLF</code> $B$HEy2A$H$_$J$7$^$9!#(B)
138 wakaba 1.5 $B>-Mh$NHG$G$O%*%W%7%g%s$G@)8f2DG=$K$J$k$+$b$7$l$^$;$s!#(B</li>
139     <li>$B$"$C$?$iNI$5$=$&$J5!G=$,L$<BAu$+$b$7$l$^$;$s!#(B
140     ($BM_$7$$5!G=$,L$<BAu$@$C$?$i!"(B
141 wakaba 1.6 <a href="mailto:w@suika.fam.cx">$BEE;R%a%$%k(B</a>$B$d(B
142     <a href="news://suika.fam.cx/suika.msg">suika.msg</a>
143     $B$J$I$G65$($F2<$5$$!#(B)</li>
144 wakaba 1.5 <li>$B3F%b%8%e!<%k$N%*%W%7%g%sBN7O$,$"$^$j@0Hw$5$l$F$$$^$;$s!#(B
145     ($B$=$l$G$b5$;}$A0-$/$J$$DxEY$K$OBN7OE*$@$H;W$$$^$9!#(B)</li>
146     <li>$B@bL@J8(B (document) $B$,NI$$2C8:$G$9!#(B</li>
147     </ol>
148    
149     <h2>$B:#8e$NM=Dj(B</h2>
150    
151     <ol>
152     <li>$BEE;R%K%e!<%9$NF,NN0h(B (RFC 1036,
153     <a href="spec/son-of-RFC1036">son-of-RFC1036</a>,
154     draft-usefor-article) $B$N40A4<BAu(B</li>
155     <li>$BDI2C(B/$BHsI8=`$NF,NN0h$N<BAu!#(B</li>
156     <li>documentation$B!#(B</li>
157     <li>$B;HMQNc$N:n@.!#(B</li>
158 wakaba 1.6 <li>$B4{B8%b%8%e!<%k$,MxMQ=PMh$kItJ,$O!"$=$l$r8F$S=P$9$h$&$K$9$k$+(B
159     $B$=$N(B code $B$rN.MQ$9$k!#(B</li>
160     <li>$BN`;w%b%8%e!<%k$H$N3&LL$N6&DL2=(B</li>
161 wakaba 1.5 </ol>
162    
163     <h2>$BI,MW4D6-(B</h2>
164    
165     <ol>
166     <li>Perl (perl 5.6 $B0J9_$^$?$O(B<span title="human parser">$B?M4V2r@O<T(B</span>:-))
167     <p class="note"><code class="bnf rfc822">comment</code>
168     $B$rI=$9$N$K@55,I=8=(B <code class="regex">(??{ <var>code</var> })</code>
169     $B$r;H$C$F$$$k$N$G!"$3$l$r2r<a=PMh$k!"(B
170     5.6 $B0J9_$NHG$G$"$kI,MW$,$"$j$^$9!#(B</p>
171     </li>
172     <li>Digest::MD2, Digest::MD5, Digest::SHA1
173     <p>Message-ID $B$N@8@.$K$3$l$i$r;HMQ$9$k>l9g$N$_!"(B
174 wakaba 1.6 <code>Message::Field::MsgID</code> $B$,;H$$$^$9!#(B</p>
175 wakaba 1.5 <p>$B$3$l$i$,MQ0U$5$l$F$$$J$$4D6-$G$O%(%i!<$K$J$k$N$G!"(B
176     ($B8=>u$G$O(B) $B>e5-%b%8%e!<%k$N3:EvItJ,$r=q$-49$($FBP=h$7$F2<$5$$!#(B</p>
177     </li>
178 wakaba 1.6 <li>MIME::Base64
179     <p>$B$A$J$_$K!"(B Quoted-Printable $B$d(B RFC 2231 $B$N(B
180     % $BId9f2=$O<+NO$GI|9f$7$^$9!#(B</p>
181     </li>
182 wakaba 1.5 <li>$BJ8;z%3!<%IJQ49=hM}(B
183     <p>$BF|K\8l%a%C%;!<%8$r07$&$J$iI,?\$G$7$g$&!#(B
184     $B>\$7$/$O(B<a href="#code">$BJ8;z%3!<%I$N07$$(B</a>
185     $B$N>O$r$4;2>H2<$5$$!#(B</p>
186     </li>
187     </ol>
188    
189     <h2>$BF~<j(B</h2>
190    
191     <p>suika.fam.cx $B$N(B SSH account $B$r$*;}$A$N>l9g!"(B CVS $B$+$iF~<j=PMh$^$9!#(B</p>
192    
193     <p class="example">$ cvs -d :ext:<var xml:lang="en">username</var>@suika.fam.cx:/home/cvs -d perl/lib/Message/</p>
194    
195     <p>Web $B$+$i$b<h$j=P$;$^$9!#(B &lt;<a href="/gate/cvs/perl/lib/Message/">http://suika.fam.cx/gate/cvs/perl/lib/Message/</a>&gt; (tarball $B$G0l3g<hF@$b=PMh$^$9!#(B)</p>
196    
197     <h2>$B%i%$%;%s%9(B</h2>
198    
199     <p>Message::* Perl modules $B$O<+M3%=%U%H%&%'%"$G$9!#(B
200     GNU GPL $B$K=>$C$FMxMQ=PMh$^$9!#>\$7$/$O3F%U%!%$%k$r8fMw2<$5$$!#(B</p>
201    
202     <h2>$B;29MJ88%(B</h2>
203    
204     <ul>
205     <li><a href="spec/">$B4XO"$9$k;EMM=q(B (RFC, Internet-Draft $BEy(B)</a></li>
206     </ul>
207    
208     <h2 id="code">$BJ8;z%3!<%I$N07$$(B</h2>
209    
210     <p>$BH\$7$$$3$H$GF,$rG:$^$9$N$O7y$J$N$G(B($BON(B)$B!"(B
211 wakaba 1.6 [[ $B"*(B<a href="#code-easy">$B<j$C<h$jAa$/J}K!$@$1FI$`(B</a>$B!#(B ]]
212 wakaba 1.5 Message::* $B$OId9f2=J}K!FHN)(B (CSI) $B$rL\;X$7$F<BAu$7$F$$$^$9!#(B
213     ($BC"$7(B ASCII $B$N$7$,$i$_$@$1$OCG$A@Z$C$F$$$^$;$s(B:-))
214     0x00 $B!A(B 0x7F $B$,(B ASCII ($B$^$?$O(B ASCII $B$H8+$J$7$FNI$$$b$N(B) $B$G$"$k(B
215     $B>l9g$O!"(B Message::* $B$rDL$7$?$3$H$G%G!<%?$,2u$l$k$3$H$O(B
216     $BL5$$$H;W$$$^$9!#(B</p>
217    
218     <p>($B$b$A$m$s!"(B RFC 822 $B$J$I3F;EMM$K>H$i$7$F@5E}(B($BE*(B)$B$G(B
219     $B$"$kI,MW$,$"$j$^$9!#(B <code class="bnf rfc822">atom</code>
220     $B$K(B8$B%S%C%H!&%3!<%I$,4^$^$l$F$$$k$H@5$7$/07$($^$;$s!#(B)
221     ($BAa$$OC$,!"(B <code class="bnf rfc822">quoted-string</code>
222     $B$J$I$G$O(B8$B%S%C%HF)2a$@$H$$$&$3$H$G$9!#2s$j$/$I$/$F$4$a$s$J$5$$!#(B)</p>
223    
224     <p>$B4{Dj$N>uBV$G$OJ8;z%3!<%I$K4X78$9$kJQ49=hM}$O9T$o$l$^$;$s!#(B
225     $B$7$+$7!"%U%C%/4X?t$C$]$$$b$N(B($BFf(B)$B$r;XDj$9$k$3$H$G!"(B
226     $BJQ49=hM}$r$5$;$i$l$^$9!#(B</p>
227    
228     <p>$B;XDj=PMh$k%U%C%/4X?t$C$]$$$b$N$O(B2$B<oN`$G$9!#(B
229     <code>DECODER</code> $B$O!"85$N%a%C%;!<%8$r2r@O$9$k;~(B
230     (<code class="perl">parse ()</code>) $B$KE,598F$S=P$5$l$^$9!#(B
231     <code>ENCODER</code> $B$O!"%a%C%;!<%8$H$7$FJ8;zNs2=$9$k:](B
232     (<code class="perl">stringify ()</code> $B$J$I(B) $B$KE,598F$S=P$5$l$^$9!#(B</p>
233    
234     <p>$B$3$l$i$N4X?t$O!"EvA3!"Ev3:=hM}$,8F$S=P$5$l$kA0$K;XDj$7$F$*$/(B
235     $BI,MW$,$"$j$^$9!#(B
236     <samp class="perl">Message::Entity-&gt;parse</samp> $B$J$I$9$kA0$K(B
237     $BDj5A$7$F$*$/$HNI$$$G$7$g$&!#(B</p>
238    
239     <pre class="example perl">
240     require Message::MIME::Charset;
241     $Message::MIME::Charset::DECODER{'*default'} = sub {jcode::euc ($_[1])};
242     $Message::MIME::Charset::ENCODER{'*default'} = sub {jcode::jis ($_[1], 'euc')};
243     </pre>
244    
245     <p>$B$3$NNc$G$O!"(B jcode.pl $B$rJQ49=hM}$K;H$$$^$9!#(B
246     ($B$b$A$m$s!"4{$K(B <code class="perl">require</code>
247     $B$5$l$F$$$k$H2>Dj$7$F$$$^$9!#(B)</p>
248     <p>$B:G=i$N(B <code class="perl">require</code> $B$G!"JQ49=hM}$rC4Ev$7$F$$$k(B
249     <code class="perl">Message::MIME::Charset</code> $B$rFI$_9~$_$^$9!#(B
250     ($B$3$&$7$F$*$+$J$$$H!"8e$+$i4{DjCM(B (= $BL5JQ49(B) $B$G(B
251     <code class="perl">*default</code> $B$,>e=q$-$5$l$F$7$^$$$^$9!#(B)</p>
252    
253     <p>$B$3$N(B code $B$r;H$C$?%9%/%j%W%H$OFbIt=hM}$rF|K\8l(B EUC
254     $B$G9T$&$H2>Dj$7$F$$$^$9!#$G$9$+$i!"(B <code class="perl">DECODER</code>
255     $B$GF|K\8l(B EUC $B$KJQ49$7$^$9!#(B</p>
256     <p>$B$^$?!"F|K\8l%a%C%;!<%8$G$O(B <code>ISO-2022-JP</code>
257     $B$r;H$&$N$,47=,$G$9$+$i!"(B <code class="perl">ENCODER</code>
258     $B$G$O(B 7$B%S%C%H(B JIS $B$KJQ49$7$F$$$^$9!#(B</p>
259     <p>$B=hM}$r9T$&4X?t$O!"0z?t$,(B2$B$D0J>eM?$($i$l$^$9!#(B
260     1$B$DL\$N0z?t$O8F$S=P$7$?(B class module, $B$$$o$f$k(B
261     <code class="perl">$self</code> $B$G$9!#(B($B$3$N>l9g(B self $B$G$O$"$j$^$;$s$,(B:-)
262     $B$G$bIaDL$OI,MW$J$$$G$7$g$&!#(B</p>
263     <p>2$B$DL\$N0z?t$O=hM}BP>]$NJ8;zNs$G$9!#(B</p>
264     <p>3$B$DL\0J9_$N0z?t$O!"DI2C%*%W%7%g%s$N%O%C%7%e$G$9!#(B
265     $B$?$@$7!"8=:_DI2C%*%W%7%g%s$ODj5A$5$l$F$$$^$;$s!#(B</p>
266     <p>$B4X?t$,JV$9CM$O(B($B:#$N$H$3$m(B)$B0l$D$@$1$G$9!#(B
267     $B=hM}$,=*$o$C$?J8;zNs$G$9!#JQ497k2L$H$7$F2?$b$J$/$J$C$F$7$^$C$?$i!"(B
268     $B$b$A$m$s6uJ8;zNs$rJV$7$F9=$$$^$;$s!#(B (<code class="perl">undef</code>
269     $B$h$j$b6uJ8;zNs$NJ}$,K>$^$7$$$G$7$g$&!#(B)</p>
270    
271     <p>$B$5$F!">e5-$NNc$G$O!V(B<code>*default</code>$B!W$N(B EN/DECODER
272     $B$r;XDj$7$^$7$?$,!"$3$3$K$OBe$o$j$K(B charset $BL>$r;XDj=PMh$^$9!#(B</p>
273    
274     <pre class="perl example">
275     $Message::MIME::Charset::DECODER{'iso-2022-jp'} = sub {jcode::euc ($_[1], 'jis')};
276     </pre>
277    
278     <p>$B$3$3$G$O!"(B <code>ISO-2022-JP</code> $B$rFbIt%3!<%I$KJQ49$9$k(B
279     $BJ}K!$rDj5A$7$F$$$^$9!#(B charset $BL>(B ($B$*$h$S!V(B<code>*default</code>$B!W(B
280     $B$OI,$:>.J8;z$G=q$$$F2<$5$$(B!)</p>
281     <p>MIME body $B$d!"(B encoded-word, RFC 2231 $B$N3HD%%Q%i%a!<%?!<CM(B
282     $B$J$I!"(B charset $B$,;XDj$5$l$F$$$k;~$O$=$N(B charset $BL>$NJQ494X?t$,(B
283     $B8F$S=P$5$l$^$9!#(B ($B;XDj$5$l$?(B charset $BL>$NJQ494X?t$,L$Dj5A$N;~$O!"(B
284     $B2?$b=hM}$7$^$;$s!#(B) $B$3$l0J30$N>lLL$G$O!"(B <code>*default</code>
285     $B$GDj5A$5$l$?4X?t$,;H$o$l$^$9!#(B</p>
286    
287 wakaba 1.6 <!--
288 wakaba 1.5 <p>$B:G8e$K!"F|K\8l%a%C%;!<%8$r07$&:]$NNc$r5s$2$F$*$-$^$9!#(B</p>
289    
290     <pre class="example perl">
291     <span class="comment">## jcode.pl $B$r;HMQ(B</span>
292     require 'jcode.pl';
293     require Message::MIME::Charset;
294     $Message::MIME::Charset::DECODER{'*default'} = sub {jcode::euc ($_[1])};
295     $Message::MIME::Charset::DECODER{'iso-2022-jp'} = sub {jcode::euc ($_[1], 'jis')};
296     $Message::MIME::Charset::DECODER{'euc-jp'} = sub {$_[1]};
297     $Message::MIME::Charset::DECODER{'shift_jis'} = sub {jcode::euc ($_[1], 'sjis')};
298     $Message::MIME::Charset::ENCODER{'*default'} = sub {
299     my $s = $_[1];
300     <span class="comment">## $B@55,2=(B</span>
301     jcode::tr(\$s,
302     "\xa3\xb0-\xa3\xb9\xa3\xc1-\xa3\xda\xa3\xe1-\xa3\xfa\xa1\xf5".
303     "\xa1\xa4\xa1\xa5\xa1\xa7\xa1\xa8\xa1\xa9\xa1\xaa\xa1\xae".
304     "\xa1\xb0\xa1\xb2\xa1\xbf\xa1\xc3\xa1\xca\xa1\xcb\xa1\xce".
305     "\xa1\xcf\xa1\xd0\xa1\xd1\xa1\xdc\xa1\xf0\xa1\xf3\xa1\xf4".
306     "\xa1\xf6\xa1\xf7\xa1\xe1\xa2\xaf\xa2\xb0\xa2\xb2\xa2\xb1".
307     "\xa1\xe4\xa1\xe3\xA1\xC0\xA1\xA1"
308     => '0-9A-Za-z&amp;,.:;?!`^_/|()[]{}+$%#*@=\'"~-&gt;&lt;\\ ');
309     jcode::jis ($s, 'euc', 'z')
310     };
311     </pre>
312    
313     <pre class="example perl">
314     <span class="comment">## Jcode.pm $B$r;HMQ(B</span>
315     use Jcode;
316     require Message::MIME::Charset;
317     $Message::MIME::Charset::DECODER{'*default'} = sub {jcode::euc ($_[1])};
318     $Message::MIME::Charset::DECODER{'iso-2022-jp'} = sub {Jcode->new ($_[1], 'jis')->euc};
319     $Message::MIME::Charset::DECODER{'euc-jp'} = sub {$_[1]};
320     $Message::MIME::Charset::DECODER{'shift_jis'} = sub {Jcode->new ($_[1], 'sjis')->euc};
321     $Message::MIME::Charset::DECODER{'utf-8'} = sub {Jcode->new ($_[1], 'utf8')->euc};
322     $Message::MIME::Charset::ENCODER{'*default'} = sub {Jcode-&gt;new ($_[1], 'euc')-&gt;jis};
323     $Message::MIME::Charset::ENCODER{'utf-8'} = sub {Jcode-&gt;new ($_[1], 'euc')-&gt;utf8};
324     </pre>
325 wakaba 1.6 -->
326    
327     <p id="code-easy">$B$d$d$3$7$$@bL@$r$7$F$-$^$7$?$,!"<B:]LLE]$J$N$G!"F|K\8lJ8;z%3!<%IJQ49$KNI$/;H$o$l$k!"(B
328     jcode.pl $B$d(B Jcode.pm $B$J$I$N$?$a$N@_Dj$OM=$aMQ0U$7$F$"$j$^$9!#(B</p>
329    
330     <pre class="example perl">
331     <span class="comment">## $B$I$A$i$+9%$-$JJ}$r$I$&$>!#(B</span>
332     use Message::MIME::Charset::Jcode 'jcode.pl';
333     use Message::MIME::Charset::Jcode 'Jcode';
334     </pre>
335    
336     <p>$B$3$N(B1$B9T$@$1$G!"(B ISO-2022-JP, EUC-JP, Shift_JIS
337     $B$*$h$S4v$D$+$N4XO"(B charset $B$,MxMQ2DG=$K$J$j$^$9!#(B</p>
338    
339     <p>Perl 5.8 $B$K$J$C$F(B Encode $B%b%8%e!<%k$,;H$($k$h$&$K$J$l$P!"(B
340     $B$b$C$H?'!9$JJ8;z%3!<%I$,3Z$KMxMQ$G$-$k$h$&$K$J$k$H4|BT$7$F$$$^$9!#(B</p>
341 wakaba 1.5
342 wakaba 1.6 <p>$B$H$3$m$G!"$3$N$h$&$K(B charset $BBP1~=hM}$r$7$J$/$F$b!"(B
343     MIME $B$G(B charset $B;%IU$1$5$l$F%a%C%;!<%8$K4^$a$i$l$F$$$kL$CN$N(B
344     charset $B$N%G!<%?$,GK2u$5$l$k$3$H$O$"$j$^$;$s!#(B ($B$O$:$G$9!#(B)
345     ($B$=$3$$$i$,!"(B Unicoder $B$N%=%U%H%&%'%"$H$N0c$$$G$9(B($B>P(B)$B!#(B)</p>
346 wakaba 1.5
347     <div class="navigation">
348     [<a href="/" title="$B$3$N%5!<%P!<$N<sJG(B">/</a>
349     <a href="/map" title="$B$3$N%5!<%P!<$N0FFb(B" rel="index">$BCO?^(B</a>
350     <a href="/search/" title="$B$3$N%5!<%P!<$N8!:w(B">$B8!:w(B</a>]
351     <a href="http://validator.w3.org/check/referer" xml:lang="en"><img
352     src="http://www.w3.org/Icons/valid-xhtml11" id="w3c-html"
353     alt="Valid XHTML 1.1!" style="height: 31px; width: 88px" /></a>
354     <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://suika.fam.cx/~wakaba/Message-pm/introduction.ja.html" xml:lang="en">
355     <img style="width: 88px; height: 31px" id="w3c-css"
356     src="http://jigsaw.w3.org/css-validator/images/vcss"
357     alt="Valid CSS!" /></a>
358     </div>
359 wakaba 1.6 <div class="update">$Date: 2002/04/01 09:22:42 $</div>
360 wakaba 1.5 <ul class="myuri">
361     <li>&lt;URL:<a href="http://suika.fam.cx/~wakaba/Message-pm/introduction">http://suika.fam.cx/~wakaba/Message-pm/introduction</a>&gt;</li>
362     <li>&lt;CVS:<a href="http://suika.fam.cx/gate/cvs/perl/web/Message-pm/">suika.fam.cx:/home/cvs/perl/web/Message-pm/</a>&gt;</li>
363     </ul>
364     </body></html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24