New submission from Nick Coghlan: This would be along the same lines as xmlcharrefreplace and backslashreplace, but only affect surrogate escaped characters.
Unlike surrogate escape, which reproduces the escaped characters directly in the data stream, this would follow the 'replace' error handler and insert an appropriately encoded '?' character in the output stream. The use case would be any context where losing the escaped characters is preferred to either potentially injecting arbitrary binary data into the output (surrogateescape), failing with an exception (strict), or any of the other existing codecs. It would differ from 'replace' in that normal code points that can't be encoded at all would still trigger an error. ---------- components: Interpreter Core, Library (Lib) messages: 223508 nosy: ncoghlan priority: normal severity: normal status: open title: Add a new 'surrogatereplace' output only error handler versions: Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22016> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com