summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-18 19:21:00 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-18 19:21:00 (GMT)
commit3a50e7056ebfb835785c84df925d79bde6d0d209 (patch)
tree6a6f61d276043fc53dc3290cd74ed7aab3506eab /Doc
parent1e73a2467f312f7b5ebef515cca6d3a16cf36f97 (diff)
downloadcpython-3a50e7056ebfb835785c84df925d79bde6d0d209.zip
cpython-3a50e7056ebfb835785c84df925d79bde6d0d209.tar.gz
cpython-3a50e7056ebfb835785c84df925d79bde6d0d209.tar.bz2
Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore
error handlers on all Windows versions. The MBCS codec is now supporting all error handlers, instead of only replace to encode and ignore to decode.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/codecs.rst7
-rw-r--r--Doc/whatsnew/3.3.rst5
2 files changed, 9 insertions, 3 deletions
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 84593f2..2a7abf9 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -1280,12 +1280,13 @@ functions can be used directly if desired.
.. module:: encodings.mbcs
:synopsis: Windows ANSI codepage
-Encode operand according to the ANSI codepage (CP_ACP). This codec only
-supports ``'strict'`` and ``'replace'`` error handlers to encode, and
-``'strict'`` and ``'ignore'`` error handlers to decode.
+Encode operand according to the ANSI codepage (CP_ACP).
Availability: Windows only.
+.. versionchanged:: 3.3
+ Support any error handler.
+
.. versionchanged:: 3.2
Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used
to encode, and ``'ignore'`` to decode.
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
index 945aa97..eb62968 100644
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -197,6 +197,11 @@ The :mod:`array` module supports the :c:type:`long long` type using ``q`` and
codecs
------
+The :mod:`~encodings.mbcs` codec has be rewritten to handle correclty
+``replace`` and ``ignore`` error handlers on all Windows versions. The
+:mod:`~encodings.mbcs` codec is now supporting all error handlers, instead of
+only ``replace`` to encode and ``ignore`` to decode.
+
Multibyte CJK decoders now resynchronize faster. They only ignore the first
byte of an invalid byte sequence. For example, ``b'\xff\n'.decode('gb2312',
'replace')`` now returns a ``\n`` after the replacement character.