The string returned by reverse() is already urlquoted. For example:
>>> reverse('cities', args=[u'Orléans'])
'.../Orl%C3%A9ans/'
Applying further encoding (such as urlquote() or urllib.quote) to the output of reverse() may produce undesirable results.Python 2.7.6 (default, Nov 26 2013, 12:47:31)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.core.urlresolvers import reverse
>>> reverse('events-index', kwargs={'tag': 'PL/SQL'})
'/calendar/tags/PL/SQL/'
>>> reverse('events-index', kwargs={'tag': 'PLЄ/SQL'})
'/calendar/tags/PL%D0%84/SQL/'
>>>
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1LDvsT-3z2NekpWHdetage14SMLsVYpjOMaK2wtLYpbJw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
But why backslash is not? How to make it urlquoted to %2F in that case?
Python 2.7.6 (default, Nov 26 2013, 12:47:31)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.core.urlresolvers import reverse
>>> reverse('events-index', kwargs={'tag': 'PL/SQL'})
'/calendar/tags/PL/SQL/'
>>> reverse('events-index', kwargs={'tag': 'PLЄ/SQL'})
'/calendar/tags/PL%D0%84/SQL/'
>>>
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a55c505d-e7d2-4a85-aade-761913d544e9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-- Peter of the Norse