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

Re: UTF8 URI Escaping

by Your Mother (Chancellor)
on Apr 11, 2012 at 20:52 UTC ( #964623=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -MURI::Escape -le 'print uri_unescape("%C2%A3")'
    
    
    perl -MCGI=param -le 'print param("q")' "q=%C2%A3"
    
    
  2. or download this
    plackup -e 'use URI::Escape; sub { [200, ["Content-Type" => "text/html
    +; charset=utf-8"], [ uri_unescape("%C2%A3") ]]}'
    HTTP::Server::PSGI: Accepting connections at http://0:5000/
    -- 
    
    
  3. or download this
    plackup -e 'use Encode; use URI::Escape; sub { [200, ["Content-Type" =
    +> "text/html; charset=utf-8"], [ decode("UTF-8", uri_unescape("%C2%A3
    +")) ]]}'
    HTTP::Server::PSGI: Accepting connections at http://0:5000/
    --
    Error: Body must be bytes and should not contain wide characters (UTF-
    +8 strings) at /usr/local/lib/perl5/site_perl/5.14.0/Plack/Middleware/
    +Lint.pm line 153
    
  4. or download this
    plackup -e 'use Encode; use URI::Escape; sub { [200, ["Content-Type" =
    +> "text/html; charset=utf-8"], [ encode("UTF-8", uri_unescape("%C2%A3
    +")) ]]}'
    HTTP::Server::PSGI: Accepting connections at http://0:5000/
    --
    £
    
  5. or download this
    perl -MCGI=param,-utf8 -le 'print param("q")' "q=%C2%A3"
    ?
    
  6. or download this
    perl -CO -MCGI=param,-utf8 -le 'print param("q")' "q=%C2%A3"
    
    
  7. or download this
    perl -MEncode -MCGI=param,-utf8 -le 'print encode("UTF-8", param("q"))
    +' "q=%C2%A3"
    
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2015-07-03 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (56 votes), past polls