"Use setlocale(), getencoding() and getlocale() instead",
DeprecationWarning, stacklevel=2
)
+ return _getdefaultlocale(envvars)
+def _getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
try:
# check if it's supported by the _locale module
import _locale
# On Android langinfo.h and CODESET are missing, and UTF-8 is
# always used in mbstowcs() and wcstombs().
return 'utf-8'
- encoding = getdefaultlocale()[1]
+ encoding = _getdefaultlocale()[1]
if encoding is None:
# LANG not set, default to UTF-8
encoding = 'utf-8'