Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
lib/URI/Encode/ | H | 18-Aug-2017 | - | 113 | 10 | |
t/ | H | 18-Aug-2017 | - | 76 | 66 | |
LICENSE | H A D | 12-Aug-2017 | 1.4 KiB | 32 | 24 | |
MANIFEST | H A D | 18-Aug-2017 | 291 | 13 | 12 | |
META.json | H A D | 18-Aug-2017 | 1.2 KiB | 52 | 51 | |
META.yml | H A D | 18-Aug-2017 | 666 | 28 | 27 | |
Makefile.PL | H A D | 12-Aug-2017 | 844 | 26 | 25 | |
README.pod | H A D | 12-Aug-2017 | 2.1 KiB | 91 | 55 | |
XS.xs | H A D | 12-Aug-2017 | 10.6 KiB | 365 | 267 | |
bench | H A D | 12-Aug-2017 | 1.4 KiB | 30 | 14 | |
ppport.h | H A D | 12-Aug-2017 | 190.9 KiB | 7,749 | 3,290 | |
utf8_valid.h | H A D | 12-Aug-2017 | 3.4 KiB | 137 | 94 |
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