From b7b17c3117cfaa998515f0b92438ccc688b2a021 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Tue, 21 Oct 2008 15:46:54 +0000 Subject: #8857 handle download names with non-ascii characters --- (limited to 'downloadmanager.py') diff --git a/downloadmanager.py b/downloadmanager.py index 8d5fae9..e41d06f 100644 --- a/downloadmanager.py +++ b/downloadmanager.py @@ -20,6 +20,7 @@ from gettext import gettext as _ import time import tempfile import urlparse +import urllib import gtk import hulahop @@ -78,6 +79,7 @@ class HelperAppLauncherDialog: dest_file = file_class.createInstance(interfaces.nsILocalFile) if default_file: + default_file = default_file.encode('utf-8', 'replace') base_name, extension = os.path.splitext(default_file) else: base_name = '' @@ -250,6 +252,7 @@ class Download: else: path = urlparse.urlparse(self._source.spec).path 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): -- cgit v0.9.1