• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

lib/URI/Encode/H18-Aug-2017-11310

t/H18-Aug-2017-7666

LICENSEH A D12-Aug-20171.4 KiB3224

MANIFESTH A D18-Aug-2017291 1312

META.jsonH A D18-Aug-20171.2 KiB5251

META.ymlH A D18-Aug-2017666 2827

Makefile.PLH A D12-Aug-2017844 2625

README.podH A D12-Aug-20172.1 KiB9155

XS.xsH A D12-Aug-201710.6 KiB365267

benchH A D12-Aug-20171.4 KiB3014

ppport.hH A D12-Aug-2017190.9 KiB7,7493,290

utf8_valid.hH A D12-Aug-20173.4 KiB13794

README.pod

1=head1 NAME
2
3URI::Encode::XS - a Perl URI encoder/decoder using C
4
5=head1 SYNOPSIS
6
7  use URI::Encode::XS qw/uri_encode uri_decode/;
8
9  my $encoded = uri_encode($data);
10  my $decoded = uri_decode($encoded);
11
12=head1 DESCRIPTION
13
14This is a Perl URI encoder/decoder written in XS based on L<RFC3986|https://tools.ietf.org/html/rfc3986>.
15This module always encodes characters that are not unreserved. When decoding,
16invalid escape sequences are preserved, e.g:
17
18  uri_decode("foo%20bar%a/"); # foo bar%a/
19  uri_decode("foo%20bar%a");  # foo bar%a
20  uri_decode("foo%20bar%");   # foo bar%
21
22As of version 0.09, the C<bench> script shows it to be significantly faster
23than C<URI::Escape>:
24
25              Rate escape encode
26  escape  144165/s     --   -98%
27  encode 8239785/s  5616%     --
28                Rate unescape   decode
29  unescape  196870/s       --     -97%
30  decode   6051468/s    2974%       --
31
32However this is just one string - the fewer encoded/decoded characters are
33in the string, the closer the benchmark is likely to be (see C<bench> for
34details of the benchmark). Different hardware will yield different results.
35
36Another fast encoder/decoder which supports custom escape lists, is
37L<URI::XSEscape|https://metacpan.org/pod/URI::XSEscape>.
38
39=head1 INSTALLATION
40
41  $ cpan URI::Encode::XS
42
43Or
44
45  $ git clone https://github.com/dnmfarrell/URI-Encode-XS
46  $ cd URI-Encode-XS
47  $ perl Makefile.PL
48  $ make
49  $ make test
50  $ make install
51
52=head1 CONTRIBUTORS
53
54=over 4
55
56=item * L<Aristotle Pagaltzis|https://github.com/ap>
57
58=item * L<Christian Hansen|https://github.com/chansen>
59
60=item * L<Jesse DuMond|https://github.com/JesseCanary>
61
62=back
63
64=head1 SEE ALSO
65
66=over 4
67
68=item * L<URI::Escape|https://metacpan.org/pod/URI::Escape>
69
70=item * L<URI::XSEscape|https://metacpan.org/pod/URI::XSEscape>
71
72=item * L<URL::Encode|https://metacpan.org/pod/URL::Encode>
73
74=item * My article about the story of this module: L<The road to a 55x speedup with XS|http://perltricks.com/article/the-road-to-a-55x-speedup-with-xs/>
75
76=back
77
78=head1 REPOSITORY
79
80L<https://github.com/dnmfarrell/URI-Encode-XS>
81
82=head1 LICENSE
83
84See LICENSE
85
86=head1 AUTHOR
87
88E<copy> 2016 David Farrell
89
90=cut
91