[issue13209] Refactor code using unicode_encode_call_errorhandler() in unicodeobject.c

2013-01-02 Thread STINNER Victor
STINNER Victor added the comment: I tried to factorize the code, but it is too complex. Each encoder handles errors differently. The most tricky is charmap: it reencodes the result of the error handler for non-ASCII characters. I'm not happy with the current situtation, but I don't see how to

[issue13209] Refactor code using unicode_encode_call_errorhandler() in unicodeobject.c

2011-10-18 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: 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:

[issue13209] Refactor code using unicode_encode_call_errorhandler() in unicodeobject.c

2011-10-18 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: +1 -- nosy: +ezio.melotti stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13209 ___