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; }
In reply to Encode a string to be suitable for a URL by da w00t
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |