Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How can I create a file named "default.asp?11=1"?

by igoryonya (Monk)
on Dec 06, 2009 at 12:59 UTC ( #811333=note: print w/replies, xml ) Need Help??


in reply to How can I create a file named "default.asp?11=1"?

I agree with the hex conversion in file names, but I'd say only convert file name invalid characters to hex as it's done in URLEncode almost. The invalid characters in windows filenames are:
\/:*?"<>|
append % to the beginning of the encoded char and also encode the % char.
my $name = "abba?@fzabb=11'a" $name =~ s/([\\\/:\*\?"<>\|])/\%unpack('H*', $1)/g; # name is now: abba%3f@fzabb=11'a%22
Or you can use ord instead of unpack.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://811333]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2021-04-16 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?