[docs] [issue16585] surrogateescape broken w/ multibytecodecs' encode

Walter Dörwald report at bugs.python.org
Sun Dec 2 11:38:36 CET 2012


Walter Dörwald added the comment:

And returning bytes is documented in PEP 383, as an extension to the PEP 293 machinery:

"""To convert non-decodable bytes, a new error handler ([2]) "surrogateescape" is introduced, which produces these surrogates. On encoding, the error handler converts the surrogate back to the corresponding byte. This error handler will be used in any API that receives or produces file names, command line arguments, or environment variables.

The error handler interface is extended to allow the encode error handler to return byte strings immediately, in addition to returning Unicode strings which then get encoded again (also see the discussion below)."""

----------
nosy: +doerwalter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16585>
_______________________________________


More information about the docs mailing list