[2.7] bpo-6393: Fix locale.getprerredencoding() on macOS by vstinner · Pull Request #1555 · python/cpython
setlocale(LC_CTYPE, oldloc) return result else: return nl_langinfo(CODESET) result = nl_langinfo(CODESET) if not result and sys.platform == 'darwin': # See above for explanation result = 'UTF-8'
### Database