From 27a1e2b02ad65f257a83110833dd11e6a2b13b58 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Mon, 27 Jul 2009 21:24:01 -0700 Subject: Only URL quote urls if they aren't ASCII. --- quoins/controllers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quoins/controllers.py b/quoins/controllers.py index f627c61..1f9e971 100644 --- a/quoins/controllers.py +++ b/quoins/controllers.py @@ -328,7 +328,10 @@ class BlogController(TGController): if obj is None: u = tg.url(self.path) elif isinstance(obj, basestring): - obj = urllib.quote(obj.encode('utf8')) + try: + obj.encode('ascii') + except: + obj = urllib.quote(obj.encode('utf8')) if obj.startswith('/'): obj = obj[1:] u = tg.url(os.path.join(self.path, obj)) elif isinstance(obj, Post): -- cgit v1.2.3