mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -77,6 +77,8 @@ class CHMReader(CHMFile):
|
||||
ans = lcid[0]
|
||||
if ans:
|
||||
try:
|
||||
if isinstance(ans, bytes):
|
||||
ans = ans.decode('ascii')
|
||||
codecs.lookup(ans)
|
||||
except Exception:
|
||||
ans = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user