Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In the following line, @list contains relative paths read from the underlying filesystem using readdir
The problem is that some of these directories can contain spaces and or & characters (and others no doubt but I haven't fallen foul of these yet!). CGI correctly urlencodes (on output) the spaces as %20 but doesn't encode the & as %26 which means that when the url is parsed on input, the & is being treated as a search parameter seperator. Meaning that in the URL:
param() returns 'Chalk ' instead of 'Chalk & Cheese' Is there some way of forcing CGI to encode the & as %26? Is there a urlencode() function I could use? Assuming there is a urlencode(), how would I incorporate this with the line above so as to have the map operate it upon each of the parameters? My attempts at searches of local and online docs have so far not turned up a solution to this. Thanks. In reply to CGI fails to urlencode & chars in outbound url's by BrowserUk
|
|