From c8358bb266b427209605ca9ca8628311a7ceb43c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 21 Oct 2012 15:19:16 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/metadata/fb2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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))