.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Sisimai::RFC2045 3pm" .TH Sisimai::RFC2045 3pm 2024-05-24 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Sisimai::RFC2045 \- MIME Utilities .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Sisimai::RFC2045; \& \& my $e = \*(Aq=?utf\-8?B?55m954yr44Gr44KD44KT44GT?=\*(Aq; \& my $v = Sisimai::RFC2045\->is_encoded(\e$e); \& print $v; # 1 \& \& my $x = Sisimai::RFC2045\->decodeH([$e]); \& print $x; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Sisimai::RFC2045 is MIME Utilities for \f(CW\*(C`Sisimai\*(C'\fR, is formerly known as \f(CW\*(C`Sisimai::MIME\*(C'\fR. .SH "CLASS METHODS" .IX Header "CLASS METHODS" .ie n .SS """\fBis_encoded(Scalar Reference)\fP""" .el .SS "\f(CW\fP\f(CBis_encoded(Scalar Reference)\fP\f(CW\fP" .IX Subsection "is_encoded(Scalar Reference)" \&\f(CWis_encoded()\fR returns that the argument is MIME-Encoded string or not. .PP .Vb 2 \& my $e = \*(Aq=?utf\-8?B?55m954yr44Gr44KD44KT44GT?=\*(Aq; \& my $v = Sisimai::RFC2045\->is_encoded(\e$e); # 1 .Ve .ie n .SS """\fBdecodeH(Array\-Ref)\fP""" .el .SS \f(CW\fP\f(CBdecodeH(Array\-Ref)\fP\f(CW\fP .IX Subsection "decodeH(Array-Ref)" \&\f(CWdecodeH()\fR is a decoder method for getting the original string from MIME-Encoded string in email headers. .PP .Vb 2 \& my $r = \*(Aq=?utf\-8?B?55m954yr44Gr44KD44KT44GT?=\*(Aq; \& my $v = Sisimai::RFC2045\->decodeH([$r]); .Ve .ie n .SS """\fBdecodeB(\eString)\fP""" .el .SS \f(CW\fP\f(CBdecodeB(\eString)\fP\f(CW\fP .IX Subsection "decodeB(String)" \&\f(CW\*(C`decodeB\*(C'\fR is a decoder method for getting the original string from MIME Base64 encoded string. .PP .Vb 2 \& my $r = \*(Aq44Gr44KD44O844KT\*(Aq; \& my $v = Sisimai::RFC2045\->decodeB(\e$r); .Ve .ie n .SS """\fBdecodeQ(\eString)\fP""" .el .SS \f(CW\fP\f(CBdecodeQ(\eString)\fP\f(CW\fP .IX Subsection "decodeQ(String)" \&\f(CW\*(C`decodeQ\*(C'\fR is a decoder method for getting the original string from MIME quoted-printable encoded string. .PP .Vb 2 \& my $r = \*(Aq=4e=65=6b=6f\*(Aq; \& my $v = Sisimai::RFC2045\->decodeQ(\e$r); .Ve .ie n .SS """\fBparameter(String, String)\fP""" .el .SS "\f(CW\fP\f(CBparameter(String, String)\fP\f(CW\fP" .IX Subsection "parameter(String, String)" \&\f(CWparameter()\fR returns the value of parameter in Content-Type header. .PP .Vb 4 \& my $r = \*(AqContent\-Type: multipart/mixed; boundary=Apple\-Mail\-1\-526612466\*(Aq; charset=utf8; \& print Sisimai::RFC2045\->parameter($r, \*(Aqcharset\*(Aq); # utf8 \& print Sisimai::RFC2045\->parameter($r, \*(Aqboundary\*(Aq); # Apple\-Mail\-1\-526612466 \& print Sisimai::RFC2045\->parameter($r); # multipart/mixed .Ve .ie n .SS """\fBboundary(String, Integer)\fP""" .el .SS "\f(CW\fP\f(CBboundary(String, Integer)\fP\f(CW\fP" .IX Subsection "boundary(String, Integer)" \&\f(CWboundary()\fR returns a boundary string from the value of Content-Type header. .PP .Vb 3 \& my $r = \*(AqContent\-Type: multipart/mixed; boundary=Apple\-Mail\-1\-526612466\*(Aq; \& my $v = Sisimai::RFC2045\->boundary($r); \& print $v; # Apple\-Mail\-1\-526612466 \& \& print Sisimai::RFC2045\->boundary($r, 0); # \-\-Apple\-Mail\-1\-526612466 \& print Sisimai::RFC2045\->boundary($r, 1); # \-\-Apple\-Mail\-1\-526612466\-\- .Ve .ie n .SS """\fBhaircut(\eString, Boolean)\fP""" .el .SS "\f(CW\fP\f(CBhaircut(\eString, Boolean)\fP\f(CW\fP" .IX Subsection "haircut(String, Boolean)" \&\f(CWhaircut()\fR remove unused headers from multipart/* block. .ie n .SS """\fBlevelout(String, \eString)\fP""" .el .SS "\f(CW\fP\f(CBlevelout(String, \eString)\fP\f(CW\fP" .IX Subsection "levelout(String, String)" \&\f(CW\*(C`levelout\*(C'\fR breaks multipart/* message block into each part and returns an array reference. .ie n .SS """\fBmakeflat(String, \eString)\fP""" .el .SS "\f(CW\fP\f(CBmakeflat(String, \eString)\fP\f(CW\fP" .IX Subsection "makeflat(String, String)" \&\f(CW\*(C`makeflat\*(C'\fR makes flat multipart/* message: This method breaks multipart/* block into each part, remove parts which are not needed to parse a bounce message such as image/* MIME type, and decode an encoded text part (text/*, message/*) in a body of each part that has \f(CW\*(C`Content\-Transfer\-Encoding\*(C'\fR header and the value of the header is quoted-printabe, base64, or 7bit. .SH AUTHOR .IX Header "AUTHOR" azumakuniyuki .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2014\-2016,2018\-2024 azumakuniyuki, All rights reserved. .SH LICENSE .IX Header "LICENSE" This software is distributed under The BSD 2\-Clause License.