[Python-checkins] r86537 - python/branches/py3k/Doc/howto/unicode.rst

georg.brandl python-checkins at python.org
Fri Nov 19 23:09:04 CET 2010


Author: georg.brandl
Date: Fri Nov 19 23:09:04 2010
New Revision: 86537

Log:
Do not put a raw REPLACEMENT CHARACTER in the document.

Modified:
   python/branches/py3k/Doc/howto/unicode.rst

Modified: python/branches/py3k/Doc/howto/unicode.rst
==============================================================================
--- python/branches/py3k/Doc/howto/unicode.rst	(original)
+++ python/branches/py3k/Doc/howto/unicode.rst	Fri Nov 19 23:09:04 2010
@@ -263,10 +263,13 @@
     UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0:
                         unexpected code byte
     >>> b'\x80abc'.decode("utf-8", "replace")
-    '�abc'
+    '?abc'
     >>> b'\x80abc'.decode("utf-8", "ignore")
     'abc'
 
+(In this code example, the Unicode replacement character has been replaced by
+a question mark because it may not be displayed on some systems.)
+
 Encodings are specified as strings containing the encoding's name.  Python 3.2
 comes with roughly 100 different encodings; see the Python Library Reference at
 :ref:`standard-encodings` for a list.  Some encodings have multiple names; for


More information about the Python-checkins mailing list