Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Probably problem with URI::Escape?

( #74402=categorized question: print w/ replies, xml ) Need Help??
Contributed by iguane on Apr 21, 2001 at 11:48 UTC
Q&A  > debugging


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 ?

Answer: Probably problem with uri_escape ?
contributed by merlyn

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.

Answer: Probably problem with uri_escape ?
contributed by arhuman

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...

Please (register and) log in if you wish to add an answer

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (4)
    As of 2015-11-27 12:48 GMT
    Find Nodes?
      Voting Booth?

      What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

      Results (728 votes), past polls