]> granicus.if.org Git - python/commitdiff
Do not put a raw REPLACEMENT CHARACTER in the document.
authorGeorg Brandl <georg@python.org>
Fri, 19 Nov 2010 22:09:04 +0000 (22:09 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 19 Nov 2010 22:09:04 +0000 (22:09 +0000)
Doc/howto/unicode.rst

index b809182bb144b58254c1041a8f688d42e5137ed3..77fcd26f75b8c2fb9ebb5a64b7e782a82759700b 100644 (file)
@@ -263,10 +263,13 @@ Unicode result).  The following examples show the differences::
     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