gh-104783: locale.getencoding() fallback uses FS encoding (#105381)

The locale.getencoding() function now uses
sys.getfilesystemencoding() if _locale.getencoding() is missing,
instead of calling locale.getdefaultlocale().
2 files changed