Merge pull request #8047 from sjackman/c.utf-8

Change the default locale to C.UTF-8 on Linux
This commit is contained in:
Shaun Jackman 2020-07-21 10:16:19 -07:00 committed by GitHub
commit ceddaa110c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,19 @@
HOMEBREW_PROCESSOR="$(uname -m)"
HOMEBREW_SYSTEM="$(uname -s)"
case "$HOMEBREW_SYSTEM" in
Darwin) HOMEBREW_MACOS="1" ;;
Linux) HOMEBREW_LINUX="1" ;;
esac
# Force UTF-8 to avoid encoding issues for users with broken locale settings.
if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]]
then
export LC_ALL="en_US.UTF-8"
if [[ -n "$HOMEBREW_MACOS" ]]
then
export LC_ALL="en_US.UTF-8"
else
export LC_ALL="C.UTF-8"
fi
fi
# USER isn't always set so provide a fall back for `brew` and subprocesses.
@ -87,13 +99,6 @@ then
odie "Cowardly refusing to continue at this prefix: $HOMEBREW_PREFIX"
fi
HOMEBREW_PROCESSOR="$(uname -m)"
HOMEBREW_SYSTEM="$(uname -s)"
case "$HOMEBREW_SYSTEM" in
Darwin) HOMEBREW_MACOS="1" ;;
Linux) HOMEBREW_LINUX="1" ;;
esac
if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" &&
-x "$HOMEBREW_PREFIX/opt/curl/bin/curl" ]] &&
"$HOMEBREW_PREFIX/opt/curl/bin/curl" --version >/dev/null