Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Probably problem with URI::Escape?

by iguane (Beadle)
on Apr 21, 2001 at 11:48 UTC ( [id://74402]=perlquestion: print w/replies, xml ) Need Help??

iguane has asked for the wisdom of the Perl Monks concerning the following question:

In the module URI::Escape, it seems to have a problem. In fact when i try to do :
print uri_escape ( '~' ) ;
the return value is the same ~ bit normaly it must be %7E .
But the reverse code  print uri_unescape ( '%7E' ) ; give the correct value ~.
Is somebody have seem the same problem ?
Thanks

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: Probably problem with uri_escape ?
by merlyn (Sage) on Apr 21, 2001 at 17:05 UTC
    The tilde has been relaxed in recent HTTP specifications to no longer need escaping, and the LWP library was updated to reflect that. In general, you'll never need to specify a collection of characters to uri_escape. It does the right standard thing.
Re: Probably problem with uri_escape ?
by arhuman (Vicar) on Apr 21, 2001 at 13:09 UTC
    From perldoc URI::Escape :
    The uri_escape() function takes an optional second argument that overrides the set of characters that are to be escaped. The set is specified as a string that can be used in a regular expression character class (between [ ]). E.g.: "\x00-\x1f\x7f-\xff" # all control and hi-bit ch +aracters "a-z" # all lower case characters "^A-Za-z" # everything not a letter
    I think you should explicitely specify the set of character to be encoded...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-19 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found