.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" 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 turned on, 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 .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "MIME::Charset 3pm" .TH MIME::Charset 3pm "2016-07-24" "perl v5.20.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" MIME::Charset \- Charset Information for MIME .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use MIME::Charset: \& \& $charset = MIME::Charset\->new("euc\-jp"); .Ve .PP Getting charset information: .PP .Vb 4 \& $benc = $charset\->body_encoding; # e.g. "Q" \& $cset = $charset\->as_string; # e.g. "US\-ASCII" \& $henc = $charset\->header_encoding; # e.g. "S" \& $cset = $charset\->output_charset; # e.g. "ISO\-2022\-JP" .Ve .PP Translating text data: .PP .Vb 6 \& ($text, $charset, $encoding) = \& $charset\->header_encode( \& "\exc9\exc2\exc5\exaa\exc0\exde\exc3\exef\exc5\exaa". \& "\exc7\exd1\exca\exaa\exbd\exd0\exce\excf\exb4\exef", \& Charset => \*(Aqeuc\-jp\*(Aq); \& # ...returns e.g. (, "ISO\-2022\-JP", "B"). \& \& ($text, $charset, $encoding) = \& $charset\->body_encode( \& "Collectioneur path\exe9tiquement ". \& "\exe9clectique de d\exe9chets", \& Charset => \*(Aqlatin1\*(Aq); \& # ...returns e.g. (, "ISO\-8859\-1", "QUOTED\-PRINTABLE"). \& \& $len = $charset\->encoded_header_len( \& "Perl\exe8\exa8\ex80\exe8\exaa\ex9e", \& Charset => \*(Aqutf\-8\*(Aq, \& Encoding => "b"); \& # ...returns e.g. 28. .Ve .PP Manipulating module defaults: .PP .Vb 3 \& MIME::Charset::alias("csEUCKR", "euc\-kr"); \& MIME::Charset::default("iso\-8859\-1"); \& MIME::Charset::fallback("us\-ascii"); .Ve .PP Non-OO functions (may be deprecated in near future): .PP .Vb 1 \& use MIME::Charset qw(:info); \& \& $benc = body_encoding("iso\-8859\-2"); # "Q" \& $cset = canonical_charset("ANSI X3.4\-1968"); # "US\-ASCII" \& $henc = header_encoding("utf\-8"); # "S" \& $cset = output_charset("shift_jis"); # "ISO\-2022\-JP" \& \& use MIME::Charset qw(:trans); \& \& ($text, $charset, $encoding) = \& header_encode( \& "\exc9\exc2\exc5\exaa\exc0\exde\exc3\exef\exc5\exaa". \& "\exc7\exd1\exca\exaa\exbd\exd0\exce\excf\exb4\exef", \& "euc\-jp"); \& # ...returns (, "ISO\-2022\-JP", "B"); \& \& ($text, $charset, $encoding) = \& body_encode( \& "Collectioneur path\exe9tiquement ". \& "\exe9clectique de d\exe9chets", \& "latin1"); \& # ...returns (, "ISO\-8859\-1", "QUOTED\-PRINTABLE"); \& \& $len = encoded_header_len( \& "Perl\exe8\exa8\ex80\exe8\exaa\ex9e", "b", "utf\-8"); # 28 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" MIME::Charset provides information about character sets used for \&\s-1MIME\s0 messages on Internet. .SS "Definitions" .IX Subsection "Definitions" The \fBcharset\fR is ``character set'' used in \s-1MIME\s0 to refer to a method of converting a sequence of octets into a sequence of characters. It includes both concepts of ``coded character set'' (\s-1CCS\s0) and ``character encoding scheme'' (\s-1CES\s0) of \s-1ISO/IEC.\s0 .PP The \fBencoding\fR is that used in \s-1MIME\s0 to refer to a method of representing a body part or a header body as sequence(s) of printable US-ASCII characters. .SS "Constructor" .IX Subsection "Constructor" .ie n .IP "$charset = MIME::Charset\->new([\s-1CHARSET\s0 [, \s-1OPTS\s0]])" 4 .el .IP "\f(CW$charset\fR = MIME::Charset\->new([\s-1CHARSET\s0 [, \s-1OPTS\s0]])" 4 .IX Item "$charset = MIME::Charset->new([CHARSET [, OPTS]])" Create charset object. .Sp \&\s-1OPTS\s0 may accept following key-value pair. \&\fB\s-1NOTE\s0\fR: When Unicode/multibyte support is disabled (see \*(L"\s-1USE_ENCODE\*(R"\s0), conversion will not be performed. So this option do not have any effects. .RS 4 .IP "Mapping => \s-1MAPTYPE\s0" 4 .IX Item "Mapping => MAPTYPE" Whether to extend mappings actually used for charset names or not. \&\f(CW"EXTENDED"\fR uses extended mappings. \&\f(CW"STANDARD"\fR uses standardized strict mappings. Default is \f(CW"EXTENDED"\fR. .RE .RS 4 .RE .SS "Getting Information of Charsets" .IX Subsection "Getting Information of Charsets" .ie n .IP "$charset\->body_encoding" 4 .el .IP "\f(CW$charset\fR\->body_encoding" 4 .IX Item "$charset->body_encoding" .PD 0 .IP "body_encoding \s-1CHARSET\s0" 4 .IX Item "body_encoding CHARSET" .PD Get recommended transfer-encoding of \s-1CHARSET\s0 for message body. .Sp Returned value will be one of \f(CW"B"\fR (\s-1BASE64\s0), \f(CW"Q"\fR (QUOTED-PRINTABLE), \&\f(CW"S"\fR (shorter one of either) or \&\f(CW\*(C`undef\*(C'\fR (might not be transfer-encoded; either 7BIT or 8BIT). This may not be same as encoding for message header. .ie n .IP "$charset\->as_string" 4 .el .IP "\f(CW$charset\fR\->as_string" 4 .IX Item "$charset->as_string" .PD 0 .IP "canonical_charset \s-1CHARSET\s0" 4 .IX Item "canonical_charset CHARSET" .PD Get canonical name for charset. .ie n .IP "$charset\->decoder" 4 .el .IP "\f(CW$charset\fR\->decoder" 4 .IX Item "$charset->decoder" Get \*(L"Encode::Encoding\*(R" object to decode strings to Unicode by charset. If charset is not specified or not known by this module, undef will be returned. .ie n .IP "$charset\->dup" 4 .el .IP "\f(CW$charset\fR\->dup" 4 .IX Item "$charset->dup" Get a copy of charset object. .ie n .IP "$charset\->encoder([\s-1CHARSET\s0])" 4 .el .IP "\f(CW$charset\fR\->encoder([\s-1CHARSET\s0])" 4 .IX Item "$charset->encoder([CHARSET])" Get \*(L"Encode::Encoding\*(R" object to encode Unicode string using compatible charset recommended to be used for messages on Internet. .Sp If optional \s-1CHARSET\s0 is specified, replace encoder (and output charset name) of \f(CW$charset\fR object with those of \s-1CHARSET,\s0 therefore, \&\f(CW$charset\fR object will be a converter between original charset and new \s-1CHARSET.\s0 .ie n .IP "$charset\->header_encoding" 4 .el .IP "\f(CW$charset\fR\->header_encoding" 4 .IX Item "$charset->header_encoding" .PD 0 .IP "header_encoding \s-1CHARSET\s0" 4 .IX Item "header_encoding CHARSET" .PD Get recommended encoding scheme of \s-1CHARSET\s0 for message header. .Sp Returned value will be one of \f(CW"B"\fR, \f(CW"Q"\fR, \f(CW"S"\fR (shorter one of either) or \f(CW\*(C`undef\*(C'\fR (might not be encoded). This may not be same as encoding for message body. .ie n .IP "$charset\->output_charset" 4 .el .IP "\f(CW$charset\fR\->output_charset" 4 .IX Item "$charset->output_charset" .PD 0 .IP "output_charset \s-1CHARSET\s0" 4 .IX Item "output_charset CHARSET" .PD Get a charset which is compatible with given \s-1CHARSET\s0 and is recommended to be used for \s-1MIME\s0 messages on Internet (if it is known by this module). .Sp When Unicode/multibyte support is disabled (see \*(L"\s-1USE_ENCODE\*(R"\s0), this function will simply return the result of \*(L"canonical_charset\*(R". .SS "Translating Text Data" .IX Subsection "Translating Text Data" .ie n .IP "$charset\->body_encode(\s-1STRING\s0 [, \s-1OPTS\s0])" 4 .el .IP "\f(CW$charset\fR\->body_encode(\s-1STRING\s0 [, \s-1OPTS\s0])" 4 .IX Item "$charset->body_encode(STRING [, OPTS])" .PD 0 .IP "body_encode \s-1STRING, CHARSET\s0 [, \s-1OPTS\s0]" 4 .IX Item "body_encode STRING, CHARSET [, OPTS]" .PD Get converted (if needed) data of \s-1STRING\s0 and recommended transfer-encoding of that data for message body. \s-1CHARSET\s0 is the charset by which \s-1STRING\s0 is encoded. .Sp \&\s-1OPTS\s0 may accept following key-value pairs. \&\fB\s-1NOTE\s0\fR: When Unicode/multibyte support is disabled (see \*(L"\s-1USE_ENCODE\*(R"\s0), conversion will not be performed. So these options do not have any effects. .RS 4 .IP "Detect7bit => \s-1YESNO\s0" 4 .IX Item "Detect7bit => YESNO" Try auto-detecting 7\-bit charset when \s-1CHARSET\s0 is not given. Default is \f(CW"YES"\fR. .IP "Replacement => \s-1REPLACEMENT\s0" 4 .IX Item "Replacement => REPLACEMENT" Specifies error handling scheme. See \*(L"Error Handling\*(R". .RE .RS 4 .Sp 3\-item list of (\fIconverted string\fR, \fIcharset for output\fR, \&\fItransfer-encoding\fR) will be returned. \&\fITransfer-encoding\fR will be either \f(CW"BASE64"\fR, \f(CW"QUOTED\-PRINTABLE"\fR, \&\f(CW"7BIT"\fR or \f(CW"8BIT"\fR. If \fIcharset for output\fR could not be determined and \fIconverted string\fR contains non-ASCII byte(s), \fIcharset for output\fR will be \f(CW\*(C`undef\*(C'\fR and \fItransfer-encoding\fR will be \f(CW"BASE64"\fR. \&\fICharset for output\fR will be \f(CW"US\-ASCII"\fR if and only if string does not contain any non-ASCII bytes. .RE .ie n .IP "$charset\->decode(\s-1STRING\s0 [,CHECK])" 4 .el .IP "\f(CW$charset\fR\->decode(\s-1STRING\s0 [,CHECK])" 4 .IX Item "$charset->decode(STRING [,CHECK])" Decode \s-1STRING\s0 to Unicode. .Sp \&\fBNote\fR: When Unicode/multibyte support is disabled (see \*(L"\s-1USE_ENCODE\*(R"\s0), this function will die. .IP "detect_7bit_charset \s-1STRING\s0" 4 .IX Item "detect_7bit_charset STRING" Guess 7\-bit charset that may encode a string \s-1STRING.\s0 If \s-1STRING\s0 contains any 8\-bit bytes, \f(CW\*(C`undef\*(C'\fR will be returned. Otherwise, Default Charset will be returned for unknown charset. .ie n .IP "$charset\->encode(\s-1STRING\s0 [, \s-1CHECK\s0])" 4 .el .IP "\f(CW$charset\fR\->encode(\s-1STRING\s0 [, \s-1CHECK\s0])" 4 .IX Item "$charset->encode(STRING [, CHECK])" Encode \s-1STRING \s0(Unicode or non-Unicode) using compatible charset recommended to be used for messages on Internet (if this module knows it). Note that string will be decoded to Unicode then encoded even if compatible charset was equal to original charset. .Sp \&\fBNote\fR: When Unicode/multibyte support is disabled (see \*(L"\s-1USE_ENCODE\*(R"\s0), this function will die. .ie n .IP "$charset\->encoded_header_len(\s-1STRING\s0 [, \s-1ENCODING\s0])" 4 .el .IP "\f(CW$charset\fR\->encoded_header_len(\s-1STRING\s0 [, \s-1ENCODING\s0])" 4 .IX Item "$charset->encoded_header_len(STRING [, ENCODING])" .PD 0 .IP "encoded_header_len \s-1STRING, ENCODING, CHARSET\s0" 4 .IX Item "encoded_header_len STRING, ENCODING, CHARSET" .PD Get length of encoded \s-1STRING\s0 for message header (without folding). .Sp \&\s-1ENCODING\s0 may be one of \f(CW"B"\fR, \f(CW"Q"\fR or \f(CW"S"\fR (shorter one of either \f(CW"B"\fR or \f(CW"Q"\fR). .ie n .IP "$charset\->header_encode(\s-1STRING\s0 [, \s-1OPTS\s0])" 4 .el .IP "\f(CW$charset\fR\->header_encode(\s-1STRING\s0 [, \s-1OPTS\s0])" 4 .IX Item "$charset->header_encode(STRING [, OPTS])" .PD 0 .IP "header_encode \s-1STRING, CHARSET\s0 [, \s-1OPTS\s0]" 4 .IX Item "header_encode STRING, CHARSET [, OPTS]" .PD Get converted (if needed) data of \s-1STRING\s0 and recommended encoding scheme of that data for message headers. \s-1CHARSET\s0 is the charset by which \s-1STRING\s0 is encoded. .Sp \&\s-1OPTS\s0 may accept following key-value pairs. \&\fB\s-1NOTE\s0\fR: When Unicode/multibyte support is disabled (see \*(L"\s-1USE_ENCODE\*(R"\s0), conversion will not be performed. So these options do not have any effects. .RS 4 .IP "Detect7bit => \s-1YESNO\s0" 4 .IX Item "Detect7bit => YESNO" Try auto-detecting 7\-bit charset when \s-1CHARSET\s0 is not given. Default is \f(CW"YES"\fR. .IP "Replacement => \s-1REPLACEMENT\s0" 4 .IX Item "Replacement => REPLACEMENT" Specifies error handling scheme. See \*(L"Error Handling\*(R". .RE .RS 4 .Sp 3\-item list of (\fIconverted string\fR, \fIcharset for output\fR, \&\fIencoding scheme\fR) will be returned. \fIEncoding scheme\fR will be either \f(CW"B"\fR, \f(CW"Q"\fR or \f(CW\*(C`undef\*(C'\fR (might not be encoded). If \fIcharset for output\fR could not be determined and \fIconverted string\fR contains non-ASCII byte(s), \fIcharset for output\fR will be \f(CW"8BIT"\fR (this is \fInot\fR charset name but a special value to represent unencodable data) and \fIencoding scheme\fR will be \f(CW\*(C`undef\*(C'\fR (should not be encoded). \&\fICharset for output\fR will be \f(CW"US\-ASCII"\fR if and only if string does not contain any non-ASCII bytes. .RE .ie n .IP "$charset\->undecode(\s-1STRING\s0 [,CHECK])" 4 .el .IP "\f(CW$charset\fR\->undecode(\s-1STRING\s0 [,CHECK])" 4 .IX Item "$charset->undecode(STRING [,CHECK])" Encode Unicode string \s-1STRING\s0 to byte string by input charset of \f(CW$charset\fR. This is equivalent to \f(CW\*(C`$charset\->decoder\->encode()\*(C'\fR. .Sp \&\fBNote\fR: When Unicode/multibyte support is disabled (see \*(L"\s-1USE_ENCODE\*(R"\s0), this function will die. .SS "Manipulating Module Defaults" .IX Subsection "Manipulating Module Defaults" .IP "alias \s-1ALIAS\s0 [, \s-1CHARSET\s0]" 4 .IX Item "alias ALIAS [, CHARSET]" Get/set charset alias for canonical names determined by \&\*(L"canonical_charset\*(R". .Sp If \s-1CHARSET\s0 is given and isn't false, \s-1ALIAS\s0 will be assigned as an alias of \&\s-1CHARSET. \s0 Otherwise, alias won't be changed. In both cases, current charset name that \s-1ALIAS\s0 is assigned will be returned. .IP "default [\s-1CHARSET\s0]" 4 .IX Item "default [CHARSET]" Get/set default charset. .Sp \&\fBDefault charset\fR is used by this module when charset context is unknown. Modules using this module are recommended to use this charset when charset context is unknown or implicit default is expected. By default, it is \f(CW"US\-ASCII"\fR. .Sp If \s-1CHARSET\s0 is given and isn't false, it will be set to default charset. Otherwise, default charset won't be changed. In both cases, current default charset will be returned. .Sp \&\fB\s-1NOTE\s0\fR: Default charset \fIshould not\fR be changed. .IP "fallback [\s-1CHARSET\s0]" 4 .IX Item "fallback [CHARSET]" Get/set fallback charset. .Sp \&\fBFallback charset\fR is used by this module when conversion by given charset is failed and \f(CW"FALLBACK"\fR error handling scheme is specified. Modules using this module may use this charset as last resort of charset for conversion. By default, it is \f(CW"UTF\-8"\fR. .Sp If \s-1CHARSET\s0 is given and isn't false, it will be set to fallback charset. If \s-1CHARSET\s0 is \f(CW"NONE"\fR, fallback charset will be undefined. Otherwise, fallback charset won't be changed. In any cases, current fallback charset will be returned. .Sp \&\fB\s-1NOTE\s0\fR: It \fIis\fR useful that \f(CW"US\-ASCII"\fR is specified as fallback charset, since result of conversion will be readable without charset information. .IP "recommended \s-1CHARSET\s0 [, \s-1HEADERENC, BODYENC\s0 [, \s-1ENCCHARSET\s0]]" 4 .IX Item "recommended CHARSET [, HEADERENC, BODYENC [, ENCCHARSET]]" Get/set charset profiles. .Sp If optional arguments are given and any of them are not false, profiles for \s-1CHARSET\s0 will be set by those arguments. Otherwise, profiles won't be changed. In both cases, current profiles for \s-1CHARSET\s0 will be returned as 3\-item list of (\s-1HEADERENC, BODYENC, ENCCHARSET\s0). .Sp \&\s-1HEADERENC\s0 is recommended encoding scheme for message header. It may be one of \f(CW"B"\fR, \f(CW"Q"\fR, \f(CW"S"\fR (shorter one of either) or \&\f(CW\*(C`undef\*(C'\fR (might not be encoded). .Sp \&\s-1BODYENC\s0 is recommended transfer-encoding for message body. It may be one of \f(CW"B"\fR, \f(CW"Q"\fR, \f(CW"S"\fR (shorter one of either) or \&\f(CW\*(C`undef\*(C'\fR (might not be transfer-encoded). .Sp \&\s-1ENCCHARSET\s0 is a charset which is compatible with given \s-1CHARSET\s0 and is recommended to be used for \s-1MIME\s0 messages on Internet. If conversion is not needed (or this module doesn't know appropriate charset), \s-1ENCCHARSET\s0 is \f(CW\*(C`undef\*(C'\fR. .Sp \&\fB\s-1NOTE\s0\fR: This function in the future releases can accept more optional arguments (for example, properties to handle character widths, line folding behavior, ...). So format of returned value may probably be changed. Use \*(L"header_encoding\*(R", \*(L"body_encoding\*(R" or \*(L"output_charset\*(R" to get particular profile. .SS "Constants" .IX Subsection "Constants" .IP "\s-1USE_ENCODE\s0" 4 .IX Item "USE_ENCODE" Unicode/multibyte support flag. Non-empty string will be set when Unicode and multibyte support is enabled. Currently, this flag will be non-empty on Perl 5.7.3 or later and empty string on earlier versions of Perl. .SS "Error Handling" .IX Subsection "Error Handling" \&\*(L"body_encode\*(R" and \*(L"header_encode\*(R" accept following \f(CW\*(C`Replacement\*(C'\fR options: .ie n .IP """DEFAULT""" 4 .el .IP "\f(CW``DEFAULT''\fR" 4 .IX Item """DEFAULT""" Put a substitution character in place of a malformed character. For UCM-based encodings, will be used. .ie n .IP """FALLBACK""" 4 .el .IP "\f(CW``FALLBACK''\fR" 4 .IX Item """FALLBACK""" Try \f(CW"DEFAULT"\fR scheme using \fIfallback charset\fR (see \*(L"fallback\*(R"). When fallback charset is undefined and conversion causes error, code will die on error with an error message. .ie n .IP """CROAK""" 4 .el .IP "\f(CW``CROAK''\fR" 4 .IX Item """CROAK""" Code will die on error immediately with an error message. Therefore, you should trap the fatal error with eval{} unless you really want to let it die on error. Synonym is \f(CW"STRICT"\fR. .ie n .IP """PERLQQ""" 4 .el .IP "\f(CW``PERLQQ''\fR" 4 .IX Item """PERLQQ""" .PD 0 .ie n .IP """HTMLCREF""" 4 .el .IP "\f(CW``HTMLCREF''\fR" 4 .IX Item """HTMLCREF""" .ie n .IP """XMLCREF""" 4 .el .IP "\f(CW``XMLCREF''\fR" 4 .IX Item """XMLCREF""" .PD Use \f(CW\*(C`FB_PERLQQ\*(C'\fR, \f(CW\*(C`FB_HTMLCREF\*(C'\fR or \f(CW\*(C`FB_XMLCREF\*(C'\fR scheme defined by Encode module. .IP "numeric values" 4 .IX Item "numeric values" Numeric values are also allowed. For more details see \*(L"Handling Malformed Data\*(R" in Encode. .PP If error handling scheme is not specified or unknown scheme is specified, \&\f(CW"DEFAULT"\fR will be assumed. .SS "Configuration File" .IX Subsection "Configuration File" Built-in defaults for option parameters can be overridden by configuration file: \fIMIME/Charset/Defaults.pm\fR. For more details read \fIMIME/Charset/Defaults.pm.sample\fR. .SH "VERSION" .IX Header "VERSION" Consult \f(CW$VERSION\fR variable. .PP Development versions of this module may be found at . .SS "Incompatible Changes" .IX Subsection "Incompatible Changes" .IP "Release 1.001" 4 .IX Item "Release 1.001" .RS 4 .PD 0 .IP "\(bu" 4 .PD \&\fInew()\fR method returns an object when \s-1CHARSET\s0 argument is not specified. .RE .RS 4 .RE .IP "Release 1.005" 4 .IX Item "Release 1.005" .RS 4 .PD 0 .IP "\(bu" 4 .PD Restrict characters in encoded-word according to \s-1RFC 2047\s0 section 5 (3). This also affects return value of \fIencoded_header_len()\fR method. .RE .RS 4 .RE .IP "Release 1.008.2" 4 .IX Item "Release 1.008.2" .RS 4 .PD 0 .IP "\(bu" 4 .PD \&\fIbody_encoding()\fR method may also returns \f(CW"S"\fR. .IP "\(bu" 4 Return value of \fIbody_encode()\fR method for \s-1UTF\-8\s0 may include \&\f(CW"QUOTED\-PRINTABLE"\fR encoding item that in earlier versions was fixed to \&\f(CW"BASE64"\fR. .RE .RS 4 .RE .SH "SEE ALSO" .IX Header "SEE ALSO" Multipurpose Internet Mail Extensions (\s-1MIME\s0). .SH "AUTHOR" .IX Header "AUTHOR" Hatuka*nezumi \- \s-1IKEDA\s0 Soji .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2006\-2013 Hatuka*nezumi \- \s-1IKEDA\s0 Soji. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.