From c602400a68dc3ea48ac77574ffbc90537a8dccb4 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 12 Jul 2009 20:55:21 -0400 Subject: [PATCH] ztxt pdb output encoding fix. --- src/calibre/ebooks/pdb/ztxt/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/pdb/ztxt/writer.py b/src/calibre/ebooks/pdb/ztxt/writer.py index 566c0def44..ee4c5752c3 100644 --- a/src/calibre/ebooks/pdb/ztxt/writer.py +++ b/src/calibre/ebooks/pdb/ztxt/writer.py @@ -34,7 +34,7 @@ class Writer(FormatWriter): self.log.info('Compressing data...') for i in range(0, len(txt_records)): self.log.debug('\tCompressing record %i' % i) - txt_records[i] = compressor.compress(txt_records[i].encode('cp1252', 'replace')) + txt_records[i] = compressor.compress(txt_records[i]) txt_records[i] = txt_records[i] + compressor.flush(zlib.Z_FULL_FLUSH) section_lengths.append(len(txt_records[i])) crc32 = zlib.crc32(txt_records[i], crc32) & 0xffffffff