From b51e6b73a7f447cd4932b7141a3619ac37c7824d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Sep 2008 13:33:45 -0700 Subject: [PATCH] Fix #1076 (EPUB Conversion Error) --- src/calibre/utils/genshi/template/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/utils/genshi/template/base.py b/src/calibre/utils/genshi/template/base.py index 64dc08fcdd..5a675f087c 100644 --- a/src/calibre/utils/genshi/template/base.py +++ b/src/calibre/utils/genshi/template/base.py @@ -513,6 +513,9 @@ class Template(object): value = [x for x in values if x is not None] if not value: continue + for i, v in enumerate(value): + if isinstance(v, str): + value[i] = v.decode('utf-8') new_attrs.append((name, u''.join(value))) yield kind, (tag, Attrs(new_attrs)), pos