You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the ANSI encoding is available on Windows as 'mbcs', however the OEM encoding (sometimes used by console-based applications) is not easily available.
The implementation is identical to PyUnicode_DecodeMBCS[Stateful], simply passing CP_OEM instead of CP_ACP.
Forgot to include the oem.py file in that patch, but it's basically identical to mbcs.py except calling 'oem_encode' and 'oem_decode'. It'll be in the next one
Activity
zooba commentedon Sep 5, 2016
Currently the ANSI encoding is available on Windows as 'mbcs', however the OEM encoding (sometimes used by console-based applications) is not easily available.
The implementation is identical to PyUnicode_DecodeMBCS[Stateful], simply passing CP_OEM instead of CP_ACP.
zooba commentedon Sep 5, 2016
While I'm here, should also move
aliasmbcsfrom site.py into initialization - no reason for this behaviour to depend on importing site.zooba commentedon Sep 6, 2016
Initial patch attached - tests to follow.
zooba commentedon Sep 6, 2016
Forgot to include the oem.py file in that patch, but it's basically identical to mbcs.py except calling 'oem_encode' and 'oem_decode'. It'll be in the next one
zooba commentedon Sep 6, 2016
Addressed most of the feedback, though I think having a fallback search function instead of the alias is better.
vstinner commentedon Sep 6, 2016
Rebased patch to get a review button.
python-dev commentedon Sep 7, 2016
New changeset c499690f606c by Steve Dower in branch 'default':
Issue bpo-27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec lookup
https://hg.python.org/cpython/rev/c499690f606c
python-dev commentedon Sep 7, 2016
New changeset fd0e62300fb7 by Steve Dower in branch 'default':
Issue bpo-27959: Documents new encoding and alias.
https://hg.python.org/cpython/rev/fd0e62300fb7
python-dev commentedon Sep 7, 2016
New changeset 786c34bdc27a by Steve Dower in branch 'default':
Issue bpo-27959: Updates NEWS and whatsnew
https://hg.python.org/cpython/rev/786c34bdc27a
python-dev commentedon Sep 7, 2016
New changeset 47b4dbd451f5 by Steve Dower in branch 'default':
Issue bpo-27959: Prevent ImportError from escaping codec search function
https://hg.python.org/cpython/rev/47b4dbd451f5
python-dev commentedon Sep 9, 2016
New changeset 4e80a157ea66 by Steve Dower in branch 'default':
Revert bpo-27959: ImportError within an encoding module should also skip the encoding
https://hg.python.org/cpython/rev/4e80a157ea66
zooba commentedon Sep 9, 2016
Last commit was supposed to be for bpo-28005