Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: UTF8 URI Escaping

by Your Mother (Canon)
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 rifling through the Monastery: (9)
As of 2014-10-21 01:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (95 votes), past polls