Solved Issue #80 UnicodeEncodeError

This commit is contained in:
brn 2014-08-01 20:04:17 +03:00
parent e138d4e865
commit 85c72f1980
2 changed files with 3 additions and 3 deletions

View File

@ -103,7 +103,7 @@ def index(slug_candidate):
return render_template_string(
open('{0}/index.html'.format(onionshare_dir)).read(),
slug=slug,
filename=os.path.basename(filename),
filename=os.path.basename(filename).decode("utf-8"),
filehash=filehash,
filesize=filesize,
filesize_human=human_readable_filesize(filesize),

View File

@ -38,7 +38,7 @@ class Window(QWebView):
def __init__(self, basename, webapp_port):
global window_icon
QWebView.__init__(self)
self.setWindowTitle("{0} | OnionShare".format(basename))
self.setWindowTitle(u"{0} | OnionShare".format(basename.decode("utf-8")))
self.resize(580, 400)
self.setMinimumSize(580, 400)
self.setMaximumSize(580, 400)
@ -65,7 +65,7 @@ def select_file(strings, filename=None):
if not filename:
return False, False
filename = str(filename)
filename = str(unicode(filename).encode("utf-8"))
# validate filename
if not os.path.isfile(filename):