bpo-6393: Fix locale.getprerredencoding() on macOS (#1555)

Fix for bpo-6393: Python crashes on OSX when $LANG is set to some (but
not all) invalid values due to an invalid result from nl_langinfo

(cherry picked from commit 6d77e07196bfb5dfa4de6f5d80b2619c0643a75e)
1 file changed