.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 "MIME::EcoEncode::Param 3pm" .TH MIME::EcoEncode::Param 3pm "2022-10-13" "perl v5.34.0" "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" MIME::EcoEncode::Param \- RFC 2231 Encode/Decode .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 10 \& use MIME::EcoEncode::Param; \& $encoded = mime_eco_param($str, \*(AqUTF\-8\*(Aq); # encode utf8 string \& $encoded = mime_eco_param($str, "UTF\-8\*(AqXX\*(Aq"); # XX is language \& $encoded = mime_eco_param($str, \*(AqUTF\-8*XX?B\*(Aq); # "B" encoding \& $encoded = mime_eco_param($str, \*(AqUTF\-8*XX?Q\*(Aq); # "Q" encoding \& $encoded = mime_eco_param($str, \*(AqGB2312\*(Aq); # euc\-cn string \& $encoded = mime_eco_param($str, \*(AqEUC\-KR\*(Aq); # euc\-kr string \& $encoded = mime_eco_param($str, \*(AqBig5\*(Aq); # big5 string \& $encoded = mime_eco_param($str, \*(AqShift_JIS\*(Aq); # cp932 string \& $encoded = mime_eco_param($str, \*(AqISO\-2022\-JP\*(Aq); # 7bit\-jis string \& $encoded = mime_eco_param($str, $sbcs); # $sbcs : \& # single\-byte charset \& # (e.g. \*(AqISO\-8859\-1\*(Aq) \& \& $decoded = mime_deco_param($encoded); # decode encoded string \& \& ($decoded, $param, $charset, $lang, $value) # return array \& = mime_deco_param($encoded); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module implements \s-1RFC 2231\s0 Mime Parameter Value Encoding. .SS "Options" .IX Subsection "Options" .Vb 10 \& $encoded = mime_eco_param($str, $charset, $lf, $bpl); \& # $charset : \*(AqUTF\-8\*(Aq / "UTF\-8\*(AqXX\*(Aq" / \& # \*(AqUTF\-8*XX?B\*(Aq / \*(AqUTF\-8*XX?Q\*(Aq / \& # \*(AqGB2312\*(Aq / \*(AqEUC\-KR\*(Aq / \*(AqBig5\*(Aq / \& # \*(AqShift_JIS\*(Aq / \*(AqISO\-2022\-JP\*(Aq / ... \& # (default: \*(AqUTF\-8\*(Aq) \& # Note: The others are all encoded as \& # single\-byte string. \& # $lf : line feed (default: "\en") \& # $bpl : bytes per line (default: 76) \& \& $decoded = mime_deco_param($encoded, $bq_on); \& # $bq_on : 1 : ON decode "B/Q" encoding \& # 0 : OFF \& # (default: 1) .Ve .SS "Examples" .IX Subsection "Examples" Ex1 \- \s-1RFC 2231\s0 encoding .PP .Vb 3 \& use MIME::EcoEncode::Param; \& my $str = " filename=\exe5\exaf\ex8c\exe5\exa3\exab\exe5\exb1\exb1_2013.jpeg"; \& print mime_eco_param($str, "UTF\-8\*(Aqja\*(Aq", "\en", 33), "\en"; .Ve .PP Ex1's output: .PP .Vb 3 \& filename*0*=UTF\-8\*(Aqja\*(Aq%E5%AF%8C; \& filename*1*=%E5%A3%AB%E5%B1%B1_; \& filename*2=2013.jpeg .Ve .PP Ex2 \- \*(L"Q\*(R" encoding (for Windows) .PP .Vb 3 \& use MIME::EcoEncode::Param; \& my $str = " name=\exe5\exaf\ex8c\exe5\exa3\exab\exe5\exb1\exb1_2013.jpeg"; \& print mime_eco_param($str, \*(AqUTF\-8?Q\*(Aq, "\en", 33), "\en"; .Ve .PP Ex2's output: .PP .Vb 3 \& name="=?UTF\-8?Q?=E5=AF=8C=E5?= \& =?UTF\-8?Q?=A3=AB=E5=B1=B1=5F20?= \& =?UTF\-8?Q?13.jpeg?=" .Ve .PP Ex3 \- \*(L"B\*(R" encoding (for Windows) .PP .Vb 3 \& use MIME::EcoEncode::Param; \& my $str = " name=\exe5\exaf\ex8c\exe5\exa3\exab\exe5\exb1\exb1_2013.jpeg"; \& print mime_eco_param($str, \*(AqUTF\-8?B\*(Aq, "\en", 33), "\en"; .Ve .PP Ex3's output: .PP .Vb 2 \& name="=?UTF\-8?B?5a+M5aOr5bGx?= \& =?UTF\-8?B?XzIwMTMuanBlZw==?=" .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" MIME::EcoEncode .SH "AUTHOR" .IX Header "AUTHOR" \&\s-1MURATA\s0 Yasuhisa .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2013 \s-1MURATA\s0 Yasuhisa .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.