Perl:UrlEncode

Aus Weis nix

Wechseln zu: Navigation, Suche
sub URLEncode {
 my $theURL = $_[0];
 my $MetaChars = quotemeta( ';,/?\|=+)(*&^%$#@!~:');
 $theURL =~ s/([$MetaChars\"\'\x80-\xFF])/"%" .
 uc(sprintf("%2.2x",         ord($1)))/eg;
 $theURL =~ s/ /\+/g;
 return $theURL;
}
Persönliche Werkzeuge