line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2022 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
|
|
1250
|
use vars '$VERSION'; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
486
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.012'; |
12
|
|
|
|
|
|
|
|
13
|
8
|
|
|
8
|
|
44
|
use base 'Mail::Message::TransferEnc'; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
2999
|
|
14
|
|
|
|
|
|
|
|
15
|
8
|
|
|
8
|
|
52
|
use strict; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
133
|
|
16
|
8
|
|
|
8
|
|
34
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
2071
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub name() { '8bit' } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#------------------------------------------ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub check($@) |
24
|
0
|
|
|
0
|
1
|
0
|
{ my ($self, $body, %args) = @_; |
25
|
0
|
|
|
|
|
0
|
$body; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#------------------------------------------ |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub decode($@) |
31
|
6
|
|
|
6
|
1
|
23
|
{ my ($self, $body, %args) = @_; |
32
|
6
|
|
|
|
|
29
|
$body->transferEncoding('none'); |
33
|
6
|
|
|
|
|
19
|
$body; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#------------------------------------------ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub encode($@) |
39
|
30
|
|
|
30
|
1
|
133
|
{ my ($self, $body, %args) = @_; |
40
|
|
|
|
|
|
|
|
41
|
30
|
|
|
|
|
57
|
my @lines; |
42
|
30
|
|
|
|
|
56
|
my $changes = 0; |
43
|
|
|
|
|
|
|
|
44
|
30
|
|
|
|
|
143
|
foreach ($body->lines) |
45
|
102
|
100
|
|
|
|
242
|
{ $changes++ if s/[\000\013]//g; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# there shouldn't be any NL inside a line. |
48
|
102
|
50
|
|
|
|
193
|
$changes++ if length > 997; |
49
|
102
|
|
|
|
|
258
|
push @lines, substr($_, 0, 996, '')."\n" |
50
|
|
|
|
|
|
|
while length > 997; |
51
|
|
|
|
|
|
|
|
52
|
102
|
|
|
|
|
217
|
push @lines, $_; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
30
|
100
|
|
|
|
89
|
unless($changes) |
56
|
29
|
|
|
|
|
110
|
{ $body->transferEncoding('8bit'); |
57
|
29
|
|
|
|
|
101
|
return $body; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
33
|
|
|
4
|
my $bodytype = $args{result_type} || ref $body; |
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
|
|
4
|
$bodytype->new |
63
|
|
|
|
|
|
|
( based_on => $body |
64
|
|
|
|
|
|
|
, transfer_encoding => '8bit' |
65
|
|
|
|
|
|
|
, data => \@lines |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
#------------------------------------------ |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |