blib/lib/Catmandu/Fix/uri_decode.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 96.8% 31 / 32 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Catmandu/Fix/add_to_exporter.pm ↑ Summary blib/lib/Catmandu/Fix/set_array.pm »
1 package Catmandu::Fix::uri_decode;
2  
3 2 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 our $VERSION = '1.0201_02';
6  
7 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Encode ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use URI::Escape ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 has path => (fix_arg => 1);
14  
15 2 with 'Catmandu::Fix::SimpleGetValue';
16  
17 sub emit_value {
18 3 ▶ my ($self, $var) = @_;
Subroutine emit_value: called CC=1 SCAR=0.0
Pod undocumented
19 3 "${var} = Encode::decode_utf8(URI::Escape::uri_unescape(${var}));";
20 }
21  
22 2 1;
23  
24 __END__
25  
26 =pod
27  
28 =encoding utf8
29  
30 =head1 NAME
31  
32 Catmandu::Fix::uri_decode - percent decode a URI
33  
34 =head1 SYNOPSIS
35  
36 # '3%A9' => 'café'
37 uri_decode(place)
38  
39 # '%E1%BD%81+%CF%84%E1%BF%B6%CE%BD+%CE%A0%CE%AD%CF%81%CF%83%CF%89%CE%BD+%CE%B2%CE%B1%CF%83%CE%B9%CE%BB%CE%B5%CF%8D%CF%82' => 'ὁ τῶν Πέρσων βασιλεύς'
40 uri_decode(title)
41  
42 =head1 SEE ALSO
43  
44 L<Catmandu::Fix>, L<Catmandu::Fix::uri_encode>, L<URI::Escape>
45  
46 =cut
« blib/lib/Catmandu/Fix/add_to_exporter.pm ↑ Summary blib/lib/Catmandu/Fix/set_array.pm »