[Python-checkins] r72150 - peps/trunk/pep-0383.txt

martin.v.loewis python-checkins at python.org
Thu Apr 30 17:56:46 CEST 2009


Author: martin.v.loewis
Date: Thu Apr 30 17:56:46 2009
New Revision: 72150

Log:
Explain why \0 escaping is bad.


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 17:56:46 2009
@@ -149,6 +149,14 @@
 * use different escape schemes, such as escaping with a NUL
   character, or mapping to infrequent characters.
 
+Of these proposals, the approach of escaping each byte XX
+with the sequence U+0000 U+00XX has the disadvantage that
+encoding to UTF-8 will introduce a NUL byte in the UTF-8
+sequence. As a consequence, C libraries may interpret this
+as a string termination, even though the string continues.
+In particular, the gtk libraries will truncate text in this
+case; other libraries may show similar problems.
+
 References
 ==========
 


More information about the Python-checkins mailing list