[Python-checkins] r72143 - peps/trunk/pep-0383.txt
martin.v.loewis
python-checkins at python.org
Thu Apr 30 09:02:13 CEST 2009
Author: martin.v.loewis
Date: Thu Apr 30 09:02:13 2009
New Revision: 72143
Log:
Add references.
Modified:
peps/trunk/pep-0383.txt
Modified: peps/trunk/pep-0383.txt
==============================================================================
--- peps/trunk/pep-0383.txt (original)
+++ peps/trunk/pep-0383.txt Thu Apr 30 09:02:13 2009
@@ -64,18 +64,19 @@
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 @@
# 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
=========
More information about the Python-checkins
mailing list