diff --git a/pep-0383.txt b/pep-0383.txt index f8144fe46..5fe77cd5e 100644 --- a/pep-0383.txt +++ b/pep-0383.txt @@ -67,8 +67,9 @@ character-oriented APIs, allowing direct conversion of the environmental data to Python str objects. On POSIX systems, Python currently applies the locale's encoding to -convert the byte data to Unicode. Non-decodable bytes will be -represented as lone half surrogate codes U+DCxx. +convert the byte data to Unicode, failing for characters that cannot +be decoded. With this PEP, non-decodable bytes will be represented as +lone half surrogate codes U+DCxx. To convert non-decodable bytes, a new error handler "python-escape" is introduced, which produces these half surrogates. On encoding, the