Fix for issue 6202
diff --git a/Lib/locale.py b/Lib/locale.py
index 479e1a9..f6d174c 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -536,10 +536,8 @@
"""
_setlocale(category, _build_localename(getdefaultlocale()))
-if sys.platform in ('win32', 'darwin', 'mac'):
+if sys.platform.startswith("win"):
# On Win32, this will return the ANSI code page
- # On the Mac, it should return the system encoding;
- # it might return "ascii" instead
def getpreferredencoding(do_setlocale = True):
"""Return the charset that the user is likely using."""
import _locale