Skip to content

Commit

Permalink
Do not put a raw REPLACEMENT CHARACTER in the document.
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Nov 19, 2010
1 parent a414e5b commit 34d4c82
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Doc/howto/unicode.rst
Expand Up @@ -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
Expand Down

0 comments on commit 34d4c82

Please sign in to comment.