How to unencode a string

Piet van Oostrum piet at
Fri Aug 28 00:51:55 CEST 2009

>>>>> jakecjacobson <jakecjacobson 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.  


>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 <piet at>
URL: [PGP 8DAE142BE17999C4]
Private email: piet at

More information about the Python-list mailing list