python - URL encoding: difference between Django's iri_to_uri and w3school list -


consider word declaração i'm trying put in url format.

what happens when use iri_to_uri django:

print iri_to_uri(u"declaração")  # declara%c3%a7%c3%a3o 

what obtain when use list in w3school:

declara%e7%e3o 
  1. why different?
  2. i'm trying obtain latter using django/python. way easily? (3rd party using , there no way around...)

i have no idea http://www.w3schools.com/tags/ref_urlencode.asp doing, output of cannot unqoted in python.

import urlparse  print urlparse.unquote('declara%e7%e3o') # declara��o print urlparse.unquote('declara%c3%a7%c3%a3o') # declaração 

but not first time, when www.w3schools.com sucks, bad place learn - loads of errors , unprecise statements.

i recommend http://w3.org , http://developer.mozilla.org/en-us instead.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -