TXT Input: Add confidence of detected encoding to debug log.

This commit is contained in:
John Schember 2011-01-02 17:32:16 -05:00
parent 46bc5c3f56
commit d9195c0632

View File

@ -50,8 +50,9 @@ class TXTInput(InputFormatPlugin):
ienc = options.input_encoding ienc = options.input_encoding
log.debug('Using user specified input encoding of %s' % ienc) log.debug('Using user specified input encoding of %s' % ienc)
else: else:
ienc = detect(txt)['encoding'] det_encoding = detect(txt)
log.debug('Detected input encoding as %s' % ienc) ienc = det_encoding['encoding']
log.debug('Detected input encoding as %s with a confidence of %s%%' % (ienc, det_encoding['confidence'] * 100))
if not ienc: if not ienc:
ienc = 'utf-8' ienc = 'utf-8'
log.debug('No input encoding specified and could not auto detect using %s' % ienc) log.debug('No input encoding specified and could not auto detect using %s' % ienc)