summaryrefslogtreecommitdiffstats
path: root/Lib/encodings/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/encodings/__init__.py')
-rw-r--r--Lib/encodings/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py
index 320011b..9a9b90b 100644
--- a/Lib/encodings/__init__.py
+++ b/Lib/encodings/__init__.py
@@ -29,6 +29,7 @@ Written by Marc-Andre Lemburg (mal@lemburg.com).
"""#"
import codecs
+import sys
from . import aliases
_cache = {}
@@ -151,3 +152,12 @@ def search_function(encoding):
# Register the search_function in the Python codec registry
codecs.register(search_function)
+
+if sys.platform == 'win32':
+ def _alias_mbcs(encoding):
+ import _bootlocale
+ if encoding == _bootlocale.getpreferredencoding(False):
+ import encodings.mbcs
+ return encodings.mbcs.getregentry()
+
+ codecs.register(_alias_mbcs)