Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #112349 > unrolled thread

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

Started byRandom832 <random832@fastmail.com>
First post2016-08-04 15:45 -0400
Last post2016-08-04 15:45 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Capturing the bad codes that raise UnicodeError exceptions during decoding Random832 <random832@fastmail.com> - 2016-08-04 15:45 -0400

#112349 — Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

FromRandom832 <random832@fastmail.com>
Date2016-08-04 15:45 -0400
SubjectRe: Capturing the bad codes that raise UnicodeError exceptions during decoding
Message-ID<mailman.177.1470339927.6033.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web