Skip to content

Instantly share code, notes, and snippets.

@rg3915
Created August 27, 2018 18:28
Show Gist options
  • Save rg3915/81004be5338ab60dd9d899298c77608f to your computer and use it in GitHub Desktop.
Save rg3915/81004be5338ab60dd9d899298c77608f to your computer and use it in GitHub Desktop.
urlencode Python 2 to HTML
urlencode Python 2 to HTML
from urllib import quote_plus
from urllib import urlencode
name = request.GET.get('name')
email = request.GET.get('email')
urlencode({
'name': name.encode('utf-8'),
'email': email.encode('utf-8'),
})
# 'name=R%C3%A9gis&[email protected]'
# ou
quote_plus(name.encode('utf-8'))
# 'R%C3%A9gis'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment