diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 632696b4ae..2e480a9941 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -787,6 +787,8 @@ class Manifest(object): # Convert to Unicode and normalize line endings data = self.oeb.decode(data) data = self.oeb.html_preprocessor(data) + # There could be null bytes in data if it had � entities in it + data = data.replace('\0', '') # Remove DOCTYPE declaration as it messes up parsing # In particular, it causes tostring to insert xmlns