mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #784
This commit is contained in:
parent
48930e7847
commit
ee9316a76c
@ -46,7 +46,10 @@ def xml_to_unicode(raw, verbose=False):
|
||||
if match is not None:
|
||||
encoding = match.group(1)
|
||||
if encoding is None:
|
||||
try:
|
||||
chardet = detect(raw)
|
||||
except:
|
||||
chardet = {'encoding':'utf-8', 'confidence':0}
|
||||
encoding = chardet['encoding']
|
||||
if chardet['confidence'] < 1 and verbose:
|
||||
print 'WARNING: Encoding detection confidence %d%%'%(chardet['confidence']*100)
|
||||
|
Loading…
x
Reference in New Issue
Block a user