From 6482a66bb7192c7d9f2fc139d3e2538f133948a7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 26 Jun 2015 14:14:42 +0530 Subject: [PATCH] Output detected encoding as well in the warning --- src/calibre/ebooks/chardet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/chardet.py b/src/calibre/ebooks/chardet.py index f75b7915e1..22ef35eca2 100644 --- a/src/calibre/ebooks/chardet.py +++ b/src/calibre/ebooks/chardet.py @@ -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()