Hi Doitsu,
Please try the following change in mobi_dict.py
Change the following:
Code:
if hordt2 is not None:
utext = u""
n = len(text)/2
offsets = struct.unpack('>%dH' % n, text)
for off in offsets:
if off < len(hordt2):
utext += unichr(hordt2[off])
else:
utext += unichr(off)
text = utext.encode('utf-8')
to
Code:
if hordt2 is not None and len(text) > 0:
utext = u""
n = len(text)/2
offsets = struct.unpack('>%dH' % n, text)
for off in offsets:
if off < len(hordt2):
utext += unichr(hordt2[off])
else:
utext += unichr(off)
text = utext.encode('utf-8')
Just the first line is changed. I think text is a null string which is freaking out struct.unpack() so we are screening this case out.
Please let me know if this helps.
KevinH