| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyrights 2001-2023 by [Mark Overmeer ]. |
|
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
|
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
|
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.03. |
|
5
|
|
|
|
|
|
|
# This code is part of distribution Mail-Message. Meta-POD processed with |
|
6
|
|
|
|
|
|
|
# OODoc into POD and HTML manual-pages. See README.md |
|
7
|
|
|
|
|
|
|
# Copyright Mark Overmeer. Licensed under the same terms as Perl itself. |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Mail::Message::TransferEnc::EightBit; |
|
10
|
8
|
|
|
8
|
|
1425
|
use vars '$VERSION'; |
|
|
8
|
|
|
|
|
24
|
|
|
|
8
|
|
|
|
|
549
|
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.013'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
8
|
|
|
8
|
|
51
|
use base 'Mail::Message::TransferEnc'; |
|
|
8
|
|
|
|
|
16
|
|
|
|
8
|
|
|
|
|
3444
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
8
|
|
|
8
|
|
53
|
use strict; |
|
|
8
|
|
|
|
|
16
|
|
|
|
8
|
|
|
|
|
155
|
|
|
16
|
8
|
|
|
8
|
|
39
|
use warnings; |
|
|
8
|
|
|
|
|
16
|
|
|
|
8
|
|
|
|
|
2277
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub name() { '8bit' } |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#------------------------------------------ |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub check($@) |
|
24
|
1
|
|
|
1
|
1
|
3
|
{ my ($self, $body, %args) = @_; |
|
25
|
1
|
|
|
|
|
5
|
$body; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#------------------------------------------ |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub decode($@) |
|
31
|
6
|
|
|
6
|
1
|
21
|
{ my ($self, $body, %args) = @_; |
|
32
|
6
|
|
|
|
|
26
|
$body->transferEncoding('none'); |
|
33
|
6
|
|
|
|
|
28
|
$body; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#------------------------------------------ |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub encode($@) |
|
39
|
30
|
|
|
30
|
1
|
105
|
{ my ($self, $body, %args) = @_; |
|
40
|
|
|
|
|
|
|
|
|
41
|
30
|
|
|
|
|
56
|
my @lines; |
|
42
|
30
|
|
|
|
|
58
|
my $changes = 0; |
|
43
|
|
|
|
|
|
|
|
|
44
|
30
|
|
|
|
|
122
|
foreach ($body->lines) |
|
45
|
102
|
100
|
|
|
|
255
|
{ $changes++ if s/[\000\013]//g; |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# there shouldn't be any NL inside a line. |
|
48
|
102
|
50
|
|
|
|
198
|
$changes++ if length > 997; |
|
49
|
102
|
|
|
|
|
192
|
push @lines, substr($_, 0, 996, '')."\n" |
|
50
|
|
|
|
|
|
|
while length > 997; |
|
51
|
|
|
|
|
|
|
|
|
52
|
102
|
|
|
|
|
206
|
push @lines, $_; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
30
|
100
|
|
|
|
84
|
unless($changes) |
|
56
|
29
|
|
|
|
|
98
|
{ $body->transferEncoding('8bit'); |
|
57
|
29
|
|
|
|
|
108
|
return $body; |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
1
|
|
33
|
|
|
7
|
my $bodytype = $args{result_type} || ref $body; |
|
61
|
|
|
|
|
|
|
|
|
62
|
1
|
|
|
|
|
5
|
$bodytype->new |
|
63
|
|
|
|
|
|
|
( based_on => $body |
|
64
|
|
|
|
|
|
|
, transfer_encoding => '8bit' |
|
65
|
|
|
|
|
|
|
, data => \@lines |
|
66
|
|
|
|
|
|
|
); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
#------------------------------------------ |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |