aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/brew7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/brew b/bin/brew
index 9cdeb1a10..0503abc09 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##*/}"