New submission from Serhiy Storchaka: The proposed patch adds the "namereplace" error handler. This error handler is almost same as the "backslashreplace" error handler, but use \N{...} escape sequences if there is a character name in Unicode database. Result is a little more human-readable (but less portable) than with "backslashreplace".
>>> '∀ x∈ℜ'.encode('ascii', 'namereplace') b'\\N{FOR ALL} x\\N{ELEMENT OF}\\N{BLACK-LETTER CAPITAL R}' The proposition was discussed and bikeshedded on Python-Ideas: http://comments.gmane.org/gmane.comp.python.ideas/21296 . ---------- components: Unicode files: namereplace_errors.patch keywords: patch messages: 203579 nosy: ezio.melotti, haypo, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Add the "namereplace" error handler type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file32748/namereplace_errors.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19676> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com