[Python-Dev] PEP 383 update: utf8b is now the error handler (original) (raw)
MRAB google at mrabarnett.plus.com
Thu May 7 17:08:49 CEST 2009
- Previous message: [Python-Dev] PEP 383 update: utf8b is now the error handler
- Next message: [Python-Dev] PEP 383 update: utf8b is now the error handler
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Walter Dörwald wrote:
Michael Urman wrote:
[...] Well, there is a way to stack error handlers, although it's not pretty: [...] codecs.registererror("surrogatesthenreplace", surrogatesthenreplace) That mitigates my arguments significantly, although I'd rather see something like errors=('surrogates', 'replace') chain the handlers without additional registrations. But that's a different PEP or arbitrary change. :) The first version of PEP 293 changed the errors argument to be a string or callable. This would have simplified handler stacking somewhat (because you don't have to register or lookup handlers) but it had the disadvantage that many "char *" arguments in the C API would have had to changed to "PyObject *". Changing the errors argument to a list of strings would have the same problem. A comma-separated or space-separated string, eg 'surrogates replace' or 'surrogates,replace'? It could be treated as handler stacking internally.
- Previous message: [Python-Dev] PEP 383 update: utf8b is now the error handler
- Next message: [Python-Dev] PEP 383 update: utf8b is now the error handler
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]