mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
TXT Input: Add confidence of detected encoding to debug log.
This commit is contained in:
parent
46bc5c3f56
commit
d9195c0632
@ -50,8 +50,9 @@ class TXTInput(InputFormatPlugin):
|
||||
ienc = options.input_encoding
|
||||
log.debug('Using user specified input encoding of %s' % ienc)
|
||||
else:
|
||||
ienc = detect(txt)['encoding']
|
||||
log.debug('Detected input encoding as %s' % ienc)
|
||||
det_encoding = detect(txt)
|
||||
ienc = det_encoding['encoding']
|
||||
log.debug('Detected input encoding as %s with a confidence of %s%%' % (ienc, det_encoding['confidence'] * 100))
|
||||
if not ienc:
|
||||
ienc = 'utf-8'
|
||||
log.debug('No input encoding specified and could not auto detect using %s' % ienc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user