From 7e0a9ea6c00a244a9b02e0ffce379e339e784462 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 30 Jul 2017 20:36:26 +0530 Subject: [PATCH] Server: Fix books that contain broken links with unicode characters in their paths not working with the browser viewer. Fixes #1704498 [Private bug](https://bugs.launchpad.net/calibre/+bug/1704498) --- src/calibre/srv/render_book.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/srv/render_book.py b/src/calibre/srv/render_book.py index e6f31c9843..aa8b90bc59 100644 --- a/src/calibre/srv/render_book.py +++ b/src/calibre/srv/render_book.py @@ -322,6 +322,8 @@ class Container(ContainerBase): frag = urlunquote(frag) url = resource_template.format(encode_url(name, frag)) else: + if isinstance(name, unicode): + name = name.encode('utf-8') url = 'missing:' + quote(name) changed.add(base) return url