Skip to content

Commit

Permalink
brew.sh: handle systems with no 'locale'
Browse files Browse the repository at this point in the history
such as Alpine Linux

Closes Linuxbrew/docker#83
  • Loading branch information
maxim-belkin committed Aug 12, 2020
1 parent 6d9bf72 commit ecbe221
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ecbe221

Please sign in to comment.