Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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


Description:

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

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (12)
    As of 2014-07-28 22:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (210 votes), past polls