18 |
-_MEMBERS => [qw|_charset|], |
-_MEMBERS => [qw|_charset|], |
19 |
-body_default_charset => 'iso-2022-int-1', |
-body_default_charset => 'iso-2022-int-1', |
20 |
-body_default_charset_input => 'iso-2022-int-1', |
-body_default_charset_input => 'iso-2022-int-1', |
21 |
|
-check_msmime => 1, |
22 |
#encoding_after_encode |
#encoding_after_encode |
23 |
#encoding_before_decode |
#encoding_before_decode |
24 |
#fill_ct => 0, |
#fill_ct => 0, |
25 |
#hook_encode_string |
#hook_encode_string |
26 |
#hook_decode_string |
#hook_decode_string |
27 |
|
#internal_charset_name |
28 |
-media_type => 'text', |
-media_type => 'text', |
29 |
-media_subtype => 'plain', |
-media_subtype => 'plain', |
30 |
-use_normalization => 1, |
-use_normalization => 1, |
81 |
my $ct; $ct = $self->{header}->field ('content-type', -new_item_unless_exist => 0) |
my $ct; $ct = $self->{header}->field ('content-type', -new_item_unless_exist => 0) |
82 |
if ref $self->{header}; |
if ref $self->{header}; |
83 |
$charset = $ct->parameter ('charset') if ref $ct; |
$charset = $ct->parameter ('charset') if ref $ct; |
84 |
|
if ($charset && $self->{option}->{check_msmime}) { |
85 |
|
my $msmime; |
86 |
|
$msmime = $self->{header}->field ('x-mimeole', -new_item_unless_exist => 0) |
87 |
|
if ref $self->{header}; |
88 |
|
$msmime = $msmime =~ /Microsoft MimeOLE/i; |
89 |
|
$charset = Message::MIME::Charset::msname2iananame ($charset) if $msmime; |
90 |
|
} |
91 |
$charset ||= $self->{option}->{encoding_before_decode}; |
$charset ||= $self->{option}->{encoding_before_decode}; |
92 |
my %s = &{$self->{option}->{hook_decode_string}} ($self, $body, |
my %s = &{$self->{option}->{hook_decode_string}} ($self, $body, |
93 |
type => 'body', charset => $charset); |
type => 'body', charset => $charset); |
130 |
if ref $self->{header}; |
if ref $self->{header}; |
131 |
my %e; |
my %e; |
132 |
unless ($self->{_charset}) { |
unless ($self->{_charset}) { |
133 |
my $charset; $charset = $ct->parameter ('charset') if ref $ct; |
my $charset; |
134 |
|
$charset = $ct->parameter ('*charset-to-be', -new_item_unless_exist => 0) if ref $ct; |
135 |
|
$charset = $ct->parameter ('charset', -new_item_unless_exist => 0) if !$charset && ref $ct; |
136 |
$charset ||= $self->{option}->{encoding_after_encode}; |
$charset ||= $self->{option}->{encoding_after_encode}; |
137 |
(%e) = &{$self->{option}->{hook_encode_string}} ($self, |
(%e) = &{$self->{option}->{hook_encode_string}} ($self, |
138 |
$self->{value}, type => 'body', |
$self->{value}, type => 'body', |
139 |
charset => $charset); |
charset => $charset); |
140 |
#$e{charset} ||= $self->{option}->{body_default_charset} |
$e{charset} ||= $self->{option}->{internal_charset_name} if $e{failed}; |
|
# if $self->{option}->{body_default_charset_input} |
|
|
# ne $self->{option}->{body_default_charset}; |
|
141 |
## Normalize |
## Normalize |
142 |
if ($option{use_normalization}) { |
if ($option{use_normalization}) { |
143 |
if ($Message::MIME::Charset::CHARSET{$charset || '*default'}->{mime_text}) { |
if ($Message::MIME::Charset::CHARSET{$charset || '*default'}->{mime_text}) { |