From d99932829d76d4e3c3754ea02c1c84cdc36933ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Thu, 30 Apr 2009 07:02:13 +0000 Subject: [PATCH] Add references. --- pep-0383.txt | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pep-0383.txt b/pep-0383.txt index 66ed1d6ba..d10762672 100644 --- a/pep-0383.txt +++ b/pep-0383.txt @@ -64,18 +64,19 @@ Specification On Windows, Python uses the wide character APIs to access character-oriented APIs, allowing direct conversion of the -environmental data to Python str objects. +environmental data to Python str objects ([1]). On POSIX systems, Python currently applies the locale's encoding to 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 -error handler converts the half 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. +To convert non-decodable bytes, a new error handler ([2]) +"python-escape" is introduced, which produces these half +surrogates. On encoding, the error handler converts the half 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 @@ -122,6 +123,17 @@ for accepting and returning bytes, would be written as:: # fn is now a str object yield fn.encode(fse, "python-escape") +References +========== + + [1] PEP 277 + "Unicode file name support for Windows NT" + http://www.python.org/dev/peps/pep-0277/ + + [2] PEP 293 + "Codec Error Handling Callbacks" + http://www.python.org/dev/peps/pep-0293/ + Copyright =========