line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::uri_decode; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
107087
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
14
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
16
|
use Moo; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
8
|
2
|
|
|
2
|
|
1287
|
use Catmandu::Util::Path qw(as_path); |
|
2
|
|
|
|
|
19
|
|
|
2
|
|
|
|
|
117
|
|
9
|
2
|
|
|
2
|
|
1094
|
use Encode qw(decode_utf8); |
|
2
|
|
|
|
|
27850
|
|
|
2
|
|
|
|
|
174
|
|
10
|
2
|
|
|
2
|
|
503
|
use URI::Escape qw(uri_unescape); |
|
2
|
|
|
|
|
1474
|
|
|
2
|
|
|
|
|
123
|
|
11
|
2
|
|
|
2
|
|
17
|
use namespace::clean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
12
|
2
|
|
|
2
|
|
1214
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
27
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _build_fixer { |
19
|
3
|
|
|
3
|
|
43
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
as_path($self->path) |
21
|
3
|
|
|
4
|
|
22
|
->updater(if_string => sub {decode_utf8(uri_unescape($_[0]))}); |
|
4
|
|
|
|
|
25
|
|
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=pod |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=encoding utf8 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Catmandu::Fix::uri_decode - percent decode a URI |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SYNOPSIS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# '3%A9' => 'café' |
39
|
|
|
|
|
|
|
uri_decode(place) |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# '%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' => 'ὁ τῶν Πέρσων βασιλεύς' |
42
|
|
|
|
|
|
|
uri_decode(title) |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 SEE ALSO |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
L<Catmandu::Fix>, L<Catmandu::Fix::uri_encode>, L<URI::Escape> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |