sub uriescape { my ($foo) = @_; my ($out); foreach (split //,$foo) { if ( $_ eq " ") {$out.="+";next}; if(ord($_) < 0x41 || ord($_) > 0x7a) { $out.=sprintf("%%%02x",ord($_)) } else { $out.=$_ } } $out; }
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Encode a string to be suitable for a URL
by Danimal (Novice) on May 17, 2000 at 05:35 UTC | |
by princepawn (Parson) on May 17, 2000 at 17:01 UTC | |
RE: Encode a string to be suitable for a URL
by Anonymous Monk on Apr 28, 2000 at 05:35 UTC | |
Re: Encode a string to be suitable for a URL
by jepri (Parson) on Feb 23, 2002 at 12:09 UTC |