diff --git a/src/calibre/ebooks/metadata/fb2.py b/src/calibre/ebooks/metadata/fb2.py index cecdfead0d..5a52ceb701 100644 --- a/src/calibre/ebooks/metadata/fb2.py +++ b/src/calibre/ebooks/metadata/fb2.py @@ -379,6 +379,10 @@ def set_metadata(stream, mi, apply_null=False, update_timestamp=False): stream.seek(0) stream.truncate() + # Apparently there exists FB2 reading software that chokes on the use of + # single quotes in xml declaration. Sigh. See + # http://www.mobileread.com/forums/showthread.php?p=2273184#post2273184 + stream.write(b'\n') stream.write(etree.tostring(root, method='xml', encoding='utf-8', - xml_declaration=True)) + xml_declaration=False))