-1

I have strings like C%2B%2B_name.zip which are supposed as url encoded. How to convert them to C++_name.zip?
Py 3.x.

Dan D.
  • 73,243
  • 15
  • 104
  • 123
Prog1020
  • 4,530
  • 8
  • 31
  • 65

2 Answers2

1

For Python 3, you will need to use:

urllib.parse.unquote('C%2B%2B_name.zip')

See urllib.parse.unquote.

Dan D.
  • 73,243
  • 15
  • 104
  • 123
0

All you need is URL library

import urllib
print urllib.unquote('C%2B%2B_name.zip')

and if you have names with other characters (not only English), then you can add .decode('utf8')

Salvador Dali
  • 214,103
  • 147
  • 703
  • 753