mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Output detected encoding as well in the warning
This commit is contained in:
parent
e9c6dbc24b
commit
6482a66bb7
@ -73,8 +73,8 @@ def force_encoding(raw, verbose, assume_utf8=False):
|
||||
if chardet['confidence'] < 1 and assume_utf8:
|
||||
encoding = 'utf-8'
|
||||
if chardet['confidence'] < 1 and verbose:
|
||||
print('WARNING: Encoding detection confidence %d%%'%(
|
||||
chardet['confidence']*100))
|
||||
print('WARNING: Encoding detection confidence for %s is %d%%'%(
|
||||
chardet['encoding'], chardet['confidence']*100))
|
||||
if not encoding:
|
||||
encoding = preferred_encoding
|
||||
encoding = encoding.lower()
|
||||
|
Loading…
x
Reference in New Issue
Block a user