Ticket #2506 (closed defect: fixed)

Opened 14 months ago

Last modified 14 months ago

epub2lrf creates file that raises UnicodeDecodeError when loaded

Reported by: jace Owned by: kovidgoyal
Priority: minor Milestone:
Component: LRF Output Version: trunk
Keywords: Cc:

Description

I used eCub to generate an epub file from HTML sources. This file is viewable using Calibre's viewer, but not on my PRS-505, where all pages show as blank.

To get around this, I used epub2lrf, but the resultant file freezes the PRS-505 and shows the following error in Calibre's viewer.

  File "build/bdist.linux-i686/egg/calibre/ebooks/lrf/lrfparser.py", line 160, in main
  File "build/bdist.linux-i686/egg/calibre/ebooks/lrf/lrfparser.py", line 28, in parse
  File "build/bdist.linux-i686/egg/calibre/ebooks/lrf/lrfparser.py", line 56, in _parse_objects
  File "build/bdist.linux-i686/egg/calibre/ebooks/lrf/objects.py", line 844, in initialize
  File "build/bdist.linux-i686/egg/calibre/ebooks/lrf/objects.py", line 705, in add_text
  File "/usr/lib/python2.6/encodings/utf_16_le.py", line 16, in decode
    return codecs.utf_16_le_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode bytes in position 262-263: illegal UTF-16 surrogate

The attached book's HTML sources are available from  http://twobits.net/

Attachments

twobits.epub Download (2.7 MB) - added by jace 14 months ago.
Two Bits (epub file)
twobits.lrf Download (2.3 MB) - added by jace 14 months ago.

Change History

Changed 14 months ago by jace

Two Bits (epub file)

Changed 14 months ago by kovidgoyal

Instead of converting to LRf try converting the EPUB to EPUB

Changed 14 months ago by jace

Changed 14 months ago by jace

  • status changed from new to closed
  • resolution set to fixed

Oh wow, that fixed it. Who would have thought of epub to epub conversion?

Note: See TracTickets for help on using tickets.