Posted By

surfeurX on 07/21/10


Tagged

urllib


Versions (?)

urlencode ascii error


 / Published in: Python
 

  1. def unicode_urlencode(params):
  2. if isinstance(params, dict):
  3. params = params.items()
  4. return urllib.urlencode([(k, v.encode('utf-8') if isinstance(v, unicode) else v)] for k, v in params)

Report this snippet  

You need to login to post a comment.