From ecbe2213e4ee19bb1b2ce434a7f9f0a2e56fa4dc Mon Sep 17 00:00:00 2001 From: Maxim Belkin Date: Wed, 12 Aug 2020 21:08:14 +0000 Subject: [PATCH] brew.sh: handle systems with no 'locale' such as Alpine Linux Closes Linuxbrew/docker#83 --- Library/Homebrew/brew.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index b958c9e1ab..a04c3e2ba6 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -6,7 +6,10 @@ case "$HOMEBREW_SYSTEM" in esac # Force UTF-8 to avoid encoding issues for users with broken locale settings. -if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]] +if ! which locale &>/dev/null +then + export LC_ALL=C +elif [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]] then if [[ -n "$HOMEBREW_MACOS" ]] then