enter_chroot.sh: Translate C.UTF-8 to a supported locale configuration

Several distributions offer a C.UTF-8 locale, but that locale does not
exist in upstream glibc.  This results in errors from locale, perl, and
other tools, complaining that the current locales don't exist.

To work around this, translate C.UTF-8 to the guaranteed-to-exist
en_US.UTF-8 locale within the chroot.  To get behavior closer to that of
the C locale, translate LC_COLLATE to C rather than en_US.UTF-8.

BUG=None
TEST="LANG=C.UTF-8 cros_sdk locale" and similar permutations.

Change-Id: I760e3df6444a6f4c58adbeb33637bf9363af3c41
Reviewed-on: https://chromium-review.googlesource.com/203785
Tested-by: Josh Triplett <josh@joshtriplett.org>
Commit-Queue: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed