From 11d3777a66d3411ff3cc20fe24d1c17c79ae6ff4 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Sun, 10 Apr 2011 09:20:49 +0100 Subject: [PATCH] accept non-ascii IRIs --- ckanext/googleanalytics/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ckanext/googleanalytics/plugin.py b/ckanext/googleanalytics/plugin.py index 63e6506..8ed6d2c 100644 --- a/ckanext/googleanalytics/plugin.py +++ b/ckanext/googleanalytics/plugin.py @@ -48,8 +48,9 @@ class GoogleAnalyticsPlugin(SingletonPlugin): # add download tracking link def js_attr(name, event): attrs = event[1][1] + href = attrs.get('href').encode('utf-8') link = '%s%s' % (resource_url, - urllib.quote(attrs.get('href'))) + urllib.quote(href)) js = "javascript: _gaq.push(['_trackPageview', '%s']);" % link return js