Merge pull request #8072 from maxim-belkin/utf8-fix

brew.sh: fixes for UTF-8
This commit is contained in:
Maxim Belkin 2020-07-28 09:01:56 -05:00 committed by GitHub
commit 06f078fad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,16 @@ then
then
export LC_ALL="en_US.UTF-8"
else
export LC_ALL="C.UTF-8"
locales=$(locale -a)
c_utf_regex='\bC\.(utf8|UTF-8)\b'
en_us_regex='\ben_US\.(utf8|UTF-8)\b'
utf_regex='\b[a-z][a-z]_[A-Z][A-Z]\.(utf8|UTF-8)\b'
if [[ $locales =~ $c_utf_regex || $locales =~ $en_us_regex || $locales =~ $utf_regex ]]
then
export LC_ALL=${BASH_REMATCH[0]}
else
export LC_ALL=C
fi
fi
fi