Re: Customizing character set conversions with an error handler

2006-03-14 Thread Jukka Aho
Serge Orlov wrote: >> # So the question becomes: how can I make this work >> # in a graceful manner? > change the return statement with this code: > > return (substitution.encode(error.encoding,"practical").decode( >error.encoding), error.start+1) Thanks, that was a quite neat re

Re: Customizing character set conversions with an error handler

2006-03-12 Thread Serge Orlov
Jukka Aho wrote: > When converting Unicode strings to legacy character encodings, it is > possible to register a custom error handler that will catch and process > all code points that do not have a direct equivalent in the target > encoding (as described in PEP 293). > > The thing to note here is

Customizing character set conversions with an error handler

2006-03-12 Thread Jukka Aho
When converting Unicode strings to legacy character encodings, it is possible to register a custom error handler that will catch and process all code points that do not have a direct equivalent in the target encoding (as described in PEP 293). The thing to note here is that the error handler it