mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:13:13 +02:00
CHM Input: Fix a regression in calibre 5.0 that broke opening of some files that dont specify a character encoding. Fixes #1922503 [E-book viewer: error opening a *.chm file](https://bugs.launchpad.net/calibre/+bug/1922503)
py3 compat
This commit is contained in:
parent
30f6fc5262
commit
a031f07214
1 changed files with 2 additions and 0 deletions
|
|
@ -77,6 +77,8 @@ def get_encoding(self):
|
|||
ans = lcid[0]
|
||||
if ans:
|
||||
try:
|
||||
if isinstance(ans, bytes):
|
||||
ans = ans.decode('ascii')
|
||||
codecs.lookup(ans)
|
||||
except Exception:
|
||||
ans = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue