[Tutor] urllib unquote

Kent Johnson kent37 at tds.net
Tue Feb 17 12:40:01 CET 2009


On Mon, Feb 16, 2009 at 8:12 AM, Norman Khine <norman at khine.net> wrote:
> Hello,
> Can someone point me in the right direction. I would like to return the
> string for the following:
>
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import base64, urllib
>>>> data = 'hL/FGNS40fjoTnp2zIqq73reK60%3D%0A'
>>>> data = urllib.unquote(data)
>>>> print base64.decodestring(data)
> ???Ը???Nzv̊??z?+?
>>>>
>
> What am I missing?

How is data created? Since it doesn't decode as you expect, either it
isn't base64 or there is some other processing needed. Do you have an
example of a data string where you know the desired decoded value?

Kent


More information about the Tutor mailing list