[issue12281] bytes.decode('mbcs', 'ignore') does replace undecodable bytes on Windows Vista or later

STINNER Victor report at bugs.python.org
Mon Jun 13 15:59:22 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Using my patch, it is possible create a codec for any code page on demand: register a function checking if the encoding name starts with "cp" and ends with a valid code page number.

Even if it is bad idea to set the OEM code page to 65001, implement a codec for this code page would solve issue #6058 (and help issues #7441 and #10920). See also issue #1602 (Unicode support of the Windows console).

I don't know if the Windows codec should be use, it available, instead of Python builtin codecs for Windows code pages (e.g. "cp1252" encoding).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12281>
_______________________________________


More information about the Python-bugs-list mailing list