diff options
Diffstat (limited to 'downloadmanager.py')
-rw-r--r-- | downloadmanager.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/downloadmanager.py b/downloadmanager.py index c396317..90d22a5 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -306,9 +306,13 @@ class Download: elif self._source.scheme == 'data': return 'Data URI' else: - path = urlparse.urlparse(self._source.spec).path + uri = self._source + if uri == None: + return '' + cls = components.classes['@mozilla.org/intl/texttosuburi;1'] + texttosuburi = cls.getService(interfaces.nsITextToSubURI) + path = texttosuburi.unEscapeURIForUI(uri.originCharset, uri.spec) location, file_name = os.path.split(path) - file_name = urllib.unquote(file_name.encode('utf-8', 'replace')) return file_name def _create_journal_object(self): |