Author haypo
Recipients haypo
Date 2011-10-18.11:50:10
SpamBayes Score 6.11073e-07
Marked as misclassified No
Message-id <1318938611.14.0.651217726677.issue13209@psf.upfronthosting.co.za>
In-reply-to
Content
It's difficult to use unicode_encode_call_errorhandler() because the caller has to:

 - resize the output buffer (and check for integer overflow on the new size)
 - handle bytes and str for the replacement string: PyUnicode_EncodeDecimal() doesn't support bytes for example
 - encode replacement str: some encoders uses ASCII, unicode_encode_ucs1() uses Latin1, PyUnicode_EncodeCharmap() uses a recursive call (without check for infinite loop!), ... ; and raise a UnicodeEncodeError if the encoding fails

It would be nice to factorize this code.

I plan this implement this refactoring, it's just a reminder for me :-)
History
Date User Action Args
2011-10-18 11:50:11hayposetrecipients: + haypo
2011-10-18 11:50:11hayposetmessageid: <1318938611.14.0.651217726677.issue13209@psf.upfronthosting.co.za>
2011-10-18 11:50:10haypolinkissue13209 messages
2011-10-18 11:50:10haypocreate