File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -348,9 +348,9 @@ Python provides also many :ref:`error handlers <errors>` used to specify how to
348348 * ``replace ``: replace undecodable bytes by � (U+FFFD) and unencodable
349349 characters by ``? `` (U+003F)
350350 * ``ignore ``: ignore undecodable bytes and unencodable characters
351- * ``backslashreplace `` (only to decode ): replace undecodable bytes by ``\xHH ``
351+ * ``backslashreplace `` (only encode ): replace unencodable bytes by ``\xHH ``
352352
353- Python 3 has two more error handlers:
353+ Python 3 has three more error handlers:
354354
355355 * ``surrogateescape ``: replace undecodable bytes (non-ASCII: ``0x80 ``\ —\
356356 ``0xFF ``) by :ref: `surrogate characters <surrogates >` (in U+DC80—U+DCFF) on
@@ -360,7 +360,8 @@ Python 3 has two more error handlers:
360360 * ``surrogatepass ``, specific to ``UTF-8 `` codec: allow encoding/decoding
361361 surrogate characters in :ref: `UTF-8 `. It is required because UTF-8 decoder of
362362 Python 3 rejects surrogate characters by default.
363-
363+ * ``backslashreplace `` (for decode): replace undecodable bytes by ``\xHH ``
364+
364365Decoding examples in Python 3:
365366
366367 * ``b'abc\xff'.decode('ASCII') `` uses the ``strict `` error handler and raises
You can’t perform that action at this time.
0 commit comments