diff --git a/bin/brew b/bin/brew index 9cdeb1a109..0503abc090 100755 --- a/bin/brew +++ b/bin/brew @@ -1,8 +1,15 @@ #!/bin/sh + chdir() { cd "$@" >/dev/null } +# 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" +fi + BREW_FILE_DIRECTORY="$(chdir "${0%/*}" && pwd -P)" HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/${0##*/}"