mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Rename utf8b error handler to surrogateescape.
This commit is contained in:
parent
e0a2b72e61
commit
43c57785d3
9 changed files with 30 additions and 30 deletions
|
@ -322,7 +322,7 @@ and implemented by all standard Python codecs:
|
|||
| ``'backslashreplace'`` | Replace with backslashed escape sequences |
|
||||
| | (only for encoding). |
|
||||
+-------------------------+-----------------------------------------------+
|
||||
| ``'utf8b'`` | Replace byte with surrogate U+DCxx. |
|
||||
| ``'surrogateescape'`` | Replace byte with surrogate U+DCxx. |
|
||||
+-------------------------+-----------------------------------------------+
|
||||
|
||||
In addition, the following error handlers are specific to a single codec:
|
||||
|
@ -335,7 +335,7 @@ In addition, the following error handlers are specific to a single codec:
|
|||
+-------------------+---------+-------------------------------------------+
|
||||
|
||||
.. versionadded:: 3.1
|
||||
The ``'utf8b'`` and ``'surrogatepass'`` error handlers.
|
||||
The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers.
|
||||
|
||||
The set of allowed values can be extended via :meth:`register_error`.
|
||||
|
||||
|
|
|
@ -64,8 +64,8 @@ perform this conversion (see :func:`sys.getfilesystemencoding`).
|
|||
|
||||
.. versionchanged:: 3.1
|
||||
On some systems, conversion using the file system encoding may
|
||||
fail. In this case, Python uses the ``utf8b`` encoding error
|
||||
handler, which means that undecodable bytes are replaced by a
|
||||
fail. In this case, Python uses the ``surrogateescape`` encoding
|
||||
error handler, which means that undecodable bytes are replaced by a
|
||||
Unicode character U+DCxx on decoding, and these are again
|
||||
translated to the original byte on encoding.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue