mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-25 15:29:42 -05:00
Solved Issue #80 UnicodeEncodeError
This commit is contained in:
parent
e138d4e865
commit
85c72f1980
@ -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),
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user