line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::uri_encode; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
212165
|
use Catmandu::Sane; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
15
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
15
|
use Moo; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
8
|
2
|
|
|
2
|
|
1756
|
use Catmandu::Util::Path qw(as_path); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
112
|
|
9
|
2
|
|
|
2
|
|
892
|
use URI::Escape qw(uri_escape_utf8); |
|
2
|
|
|
|
|
3092
|
|
|
2
|
|
|
|
|
125
|
|
10
|
2
|
|
|
2
|
|
15
|
use namespace::clean; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
19
|
|
11
|
2
|
|
|
2
|
|
1550
|
use Catmandu::Fix::Has; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
14
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Catmandu::Fix::Builder'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _build_fixer { |
18
|
3
|
|
|
3
|
|
38
|
my ($self) = @_; |
19
|
3
|
|
|
4
|
|
19
|
as_path($self->path)->updater(if_string => sub {uri_escape_utf8($_[0])}); |
|
4
|
|
|
|
|
20
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__END__ |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=pod |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=encoding utf8 |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Catmandu::Fix::uri_encode - percent encode a URI |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# 'café' => '3%A9' |
37
|
|
|
|
|
|
|
uri_encode(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_encode(title) |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SEE ALSO |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
L<Catmandu::Fix>, L<Catmandu::Fix::uri_decode>, L<URI::Escape> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|