Author: mtredinnick
Date: 2007-05-16 20:19:03 -0500 (Wed, 16 May 2007)
New Revision: 5273

Modified:
   django/branches/unicode/django/template/defaultfilters.py
   django/branches/unicode/tests/regressiontests/defaultfilters/tests.py
Log:
unicode: Fixed urlencode filter to handle IRI portions and map them to URI
portions correctly.


Modified: django/branches/unicode/django/template/defaultfilters.py
===================================================================
--- django/branches/unicode/django/template/defaultfilters.py   2007-05-16 
23:11:49 UTC (rev 5272)
+++ django/branches/unicode/django/template/defaultfilters.py   2007-05-17 
01:19:03 UTC (rev 5273)
@@ -170,7 +170,7 @@
 def urlencode(value):
     "Escapes a value for use in a URL"
     import urllib
-    return smart_unicode(urllib.quote(value))
+    return smart_unicode(urllib.quote(smart_str(value)))
 urlencode = stringfilter(urlencode)
 
 def urlize(value):

Modified: django/branches/unicode/tests/regressiontests/defaultfilters/tests.py
===================================================================
--- django/branches/unicode/tests/regressiontests/defaultfilters/tests.py       
2007-05-16 23:11:49 UTC (rev 5272)
+++ django/branches/unicode/tests/regressiontests/defaultfilters/tests.py       
2007-05-17 01:19:03 UTC (rev 5273)
@@ -115,8 +115,9 @@
 u'jack%20%26%20jill'
 >>> urlencode(1)
 u'1'
+>>> urlencode(u'S\xf8r-Tr\xf8ndelag')
+u'S%C3%B8r-Tr%C3%B8ndelag'
 
-
 >>> urlizetrunc(u'http://short.com/', 20)
 u'<a href="http://short.com/"; rel="nofollow">http://short.com/</a>'
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to