How to unencode a string

jakecjacobson jakecjacobson at
Fri Aug 28 15:57:59 CEST 2009

On Aug 27, 6:51 pm, Piet van Oostrum <p... at> wrote:
> >>>>> jakecjacobson <jakecjacob... at> (j) wrote:
> >j> This seems like a real simple newbie question but how can a person
> >j> unencode a string?  In Perl I use something like: "$part=~ s/\%([A-Fa-
> >j> f0-9]{2})/pack('C', hex($1))/seg;"
> >j> If I have a string like Word1%20Word2%20Word3 I want to get Word1
> >j> Word2 Word3.  
> urllib.unquote(string)
> >j> Would also like to handle special characters like '",(){}
> >j> [] etc/
> What would you like to do with them? Or do you mean to replace %27 by ' etc?
> --
> Piet van Oostrum <p... at>
> URL:[PGP 8DAE142BE17999C4]
> Private email: p... at

Yes, take '%27' and replace with ', etc.

More information about the Python-list mailing list