Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8c60c2

Browse files
committed
Do not put a raw REPLACEMENT CHARACTER in the document.
1 parent c5b0ec0 commit c8c60c2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Doc/howto/unicode.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,13 @@ Unicode result). The following examples show the differences::
263263
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 0:
264264
unexpected code byte
265265
>>> b'\x80abc'.decode("utf-8", "replace")
266-
'abc'
266+
'?abc'
267267
>>> b'\x80abc'.decode("utf-8", "ignore")
268268
'abc'
269269

270+
(In this code example, the Unicode replacement character has been replaced by
271+
a question mark because it may not be displayed on some systems.)
272+
270273
Encodings are specified as strings containing the encoding's name. Python 3.2
271274
comes with roughly 100 different encodings; see the Python Library Reference at
272275
:ref:`standard-encodings` for a list. Some encodings have multiple names; for

0 commit comments

Comments
 (0)