Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Probably problem with URI::Escape?

by iguane (Beadle)
on Apr 21, 2001 at 11:48 UTC ( #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 all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (4)
    As of 2018-06-18 06:22 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (108 votes). Check out past polls.