On Thu, Aug 4, 2016, at 15:22, Malcolm Greene wrote: > Hi Chris, > > Thanks for your suggestions. I would like to capture the specific bad > codes *before* they get replaced. So if a line of text has 10 bad codes > (each one raising UnicodeError), I would like to track each exception's > bad code but still return a valid decode line when finished.
Look into writing your own error handler - there's enough information provided to do this. https://docs.python.org/3/library/codecs.html -- https://mail.python.org/mailman/listinfo/python-list