| 1 | # This code is part of Perl distribution Mail-Message version 4.05. | ||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.06. | ||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | # This software is copyright (c) 2001-2026 by Mark Overmeer. | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | package Mail::Message::TransferEnc::EightBit;{ | ||||||||||||||||||||
| 13 | 8 | our $VERSION = '4.05'; | |||||||||||||||||||
| 14 | } | ||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 8 | ▶ | use parent 'Mail::Message::TransferEnc'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 8 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | 8 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 8 | ▶ | use Log::Report 'mail-message', import => [ qw// ]; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | #-------------------- | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | sub name() { '8bit' } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | sub check($@) | ||||||||||||||||||||
| 28 | 1 | ▶ | { my ($self, $body, %args) = @_; | ||||||||||||||||||
|
Subroutine
check: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 29 | 1 | $body; | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | sub decode($@) | ||||||||||||||||||||
| 33 | 7 | ▶ | { my ($self, $body, %args) = @_; | ||||||||||||||||||
|
Subroutine
decode: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 34 | 7 | $body->transferEncoding('none'); | |||||||||||||||||||
| 35 | 7 | $body; | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | sub encode($@) | ||||||||||||||||||||
| 39 | 32 | ▶ | { my ($self, $body, %args) = @_; | ||||||||||||||||||
|
Subroutine
encode: called CC=7 SCAR=19.8
Pod
documented
| |||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 32 | my @lines; | |||||||||||||||||||
| 42 | 32 | my $changes = 0; | |||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 32 | foreach ($body->lines) | |||||||||||||||||||
| 45 | 111 | ▶ | { $changes++ if s/[\000\013]//g; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | # there shouldn't be any NL inside a line. | ||||||||||||||||||||
| 48 | 111 | ▶ | $changes++ if length > 997; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | 111 | ▶ | push @lines, substr($_, 0, 996, '')."\n" | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 50 | while length > 997; | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 111 | push @lines, $_; | |||||||||||||||||||
| 53 | } | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | 32 | ▶ | unless($changes) | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 56 | 31 | { $body->transferEncoding('8bit'); | |||||||||||||||||||
| 57 | 31 | return $body; | |||||||||||||||||||
| 58 | } | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 1 | ▶ | my $bodytype = $args{result_type} || ref $body; | ||||||||||||||||||
|
Condition33%1/3
$args{'result_type'} || ref $body
MC/DC0%0/2
$args{'result_type'} || ref $body
$args{'result_type'}
ref $body
Truth table33%1/3
A || B
A= $args{'result_type'}B= ref $body
| |||||||||||||||||||||
| 61 | 1 | $bodytype->new(based_on => $body, transfer_encoding => '8bit', data => \@lines); | |||||||||||||||||||
| 62 | } | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | 8 | 1; | |||||||||||||||||||