| 1 | package WWW::Mechanize::DecodedContent; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Encode (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use HTTP::Response::Encoding; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub WWW::Mechanize::decoded_content { | ||||||||||||||||||||||||||
|
Subroutine
decoded_content: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 0 | my $mech = shift; | |||||||||||||||||||||||||||
| 11 | 0 | my $content = $mech->content(@_); | |||||||||||||||||||||||||||
| 12 | 0 | ▶ | return $content unless $mech->{ct} && $mech->{ct} =~ m!^text/!i; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$mech->{"ct"} and $mech->{"ct"} =~ m[^text/]i
MC/DC0%0/2
$mech->{"ct"} and $mech->{"ct"} =~ m[^text/]i
$mech->{"ct"}
$mech->{"ct"} =~ m[^text/]i
Truth table0%0/3
A and B
A= $mech->{"ct"}B= $mech->{"ct"} =~ m[^text/]i
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | ## WWW::Mechanize 1.50 or over calls decoded_content() to get page | ||||||||||||||||||||||||||||
| 15 | 0 | ▶ | return $content if Encode::is_utf8($content); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | if (my $enc = $mech->res->encoding) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 0 | return Encode::decode($enc, $content); | |||||||||||||||||||||||||||
| 19 | } else { | ||||||||||||||||||||||||||||
| 20 | 0 | return; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 2 | 1; | |||||||||||||||||||||||||||
| 25 | __END__ | ||||||||||||||||||||||||||||