diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index b92115bda8..55c5d81767 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -738,7 +738,7 @@ class Boss(QObject): if editor is None: if use_template is None: data = current_container().raw_data(name) - if isbytestring(data): + if isbytestring(data) and syntax in {'html', 'css', 'text', 'xml'}: try: data = data.decode('utf-8') except UnicodeDecodeError: