"""Locale utility routines."""
+__all__ = ["localelist", "encoding", "getpair"]
+
import sys
try:
except ImportError:
codecs = None
-__all__ = ["localelist"]
-
def localelist(*locales):
"""Normalize and return a list of locales, with appended defaults.
return locale.getpreferredencoding() or sys.getdefaultencoding()
def getpair(locale_, encoding_):
+ """If encoding_ is unspecified, get the locale encoding."""
if "." in locale_:
if encoding_ is None:
locale_, encoding_ = locale_.rsplit(".", 1)