NAME
URI::Encode::XS - a Perl URI encoder/decoder using C
SYNOPSIS
use URI::Encode::XS qw/uri_encode uri_decode/;
my $encoded = uri_encode($data);
my $decoded = uri_decode($encoded);
DESCRIPTION
This is a Perl URI encoder/decoder written in XS based on RFC3986. This module always encodes characters that are not unreserved. When decoding, invalid escape sequences are preserved, e.g:
uri_decode("foo%20bar%a/"); # foo bar%a/
uri_decode("foo%20bar%a"); # foo bar%a
uri_decode("foo%20bar%"); # foo bar%
As of version 0.08, the bench
script shows it to be significantly faster than URI::Escape
:
Rate escape encode
escape 142718/s -- -98%
encode 7893963/s 5431% --
Rate unescape decode
unescape 194275/s -- -97%
decode 5894526/s 2934% --
However this is just one string - the fewer encoded/decoded characters are in the string, the closer the benchmark is likely to be (see bench
for details of the benchmark). Different hardware will yield different results.
Another fast encoder/decoder which supports custom escape lists, is URI::XSEscape.
INSTALLATION
$ cpan URI::Encode::XS
Or
$ git clone https://github.com/dnmfarrell/URI-Encode-XS
$ cd URI-Encode-XS
$ perl Makefile.PL
$ make
$ make test
$ make install
CONTRIBUTORS
Jesse DuMond
REPOSITORY
https://github.com/dnmfarrell/URI-Encode-XS
LICENSE
See LICENSE
AUTHOR
© 2016 David Farrell