|
|
Thread Tools | Search this Thread |
11-11-2012, 02:36 PM | #16 |
Groupie
Posts: 191
Karma: 574940
Join Date: Jul 2012
Device: Kobo Touch, Kobo Glo, Kobo Arc(32GB), Kobo Arc 7HD, Kobo Glo HD,NookHD
|
|
11-11-2012, 05:59 PM | #17 | |
Groupie
Posts: 191
Karma: 574940
Join Date: Jul 2012
Device: Kobo Touch, Kobo Glo, Kobo Arc(32GB), Kobo Arc 7HD, Kobo Glo HD,NookHD
|
Quote:
I just updated the plugins from Tools 5.4, restarted book download process from scratch, and the book came into Calibre just fine, including the "Chapter 36" graphic which I lost when i implemented my crude "home brewed" solution (i.e. removing the offfending "corrupt" graphic file with 7Zip). |
|
11-15-2012, 12:30 PM | #18 |
Sigil Developer
Posts: 7,520
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi Kovid,
To workaround these issues, ePubFixer uses its own zipfile.py version called zipfilerugged.py which is simply the official zipfile.py file with this one change to explicitly catch the decode problem when garbage central directory filenames are used with the encoded as utf-8 flag (and they are garbage chars, not utf-16 as far as I can tell). Code:
def _decodeFilename(self): if self.flag_bits & 0x800: try: return self.filename.decode('utf-8') except: return self.filename else: return self.filename Then to fix the cases where central and local filenames differ (again because of garbage chars in some central directory filenames), ePubFixer uses the following code that imports the zipfilerugged.py (see attached zipfix.py) Your new approach of reading the entire zip by processing the local information only should be more robust and closer to what B&N is using but ePubFixer works too. Hope this helps. KevinH |
10-11-2013, 09:19 AM | #19 |
Member
Posts: 14
Karma: 366
Join Date: May 2012
Device: Android
|
|
10-11-2013, 01:54 PM | #20 |
creator of calibre
Posts: 43,796
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes, epub encryption in internal, nothing to do with zip encryption.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
'utf8' codec can't decode byte 0xd4 | anthonyliu | Calibre | 0 | 10-09-2012 12:50 AM |
Kindle Collections - utf8 invalid continuation byte | prometheus44 | Plugins | 3 | 12-16-2011 07:22 PM |
invalid library ... UnicodeDecodeError: 'utf8' codec can't ... | AhShoo5n | Calibre | 12 | 08-23-2011 12:53 PM |
Malformed byte sequence: Invalid byte 2 of 3-byte UTF-8 sequence. Check encoding | digireads | ePub | 3 | 04-26-2011 03:07 AM |
'utf8' codec can't decode bytes error (HTML to EPUB conversion) | gsz | Calibre | 10 | 10-26-2009 06:29 PM |