Skip to content

Commit ffcb098

Browse files
committed
FIX do not try to display funny symbols if encoding is not UTF-8
1 parent f0217c4 commit ffcb098

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bash_unit

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,14 @@ pretty_format() {
182182
local color="$1"
183183
local pretty_symbol="$2"
184184
local alt_symbol="$3"
185-
[ -t 1 ] && local term=true || local term=false
185+
local term_utf8=false
186+
if test -t 1 && [[ "$LANG" =~ .i*UTF-8.* ]]
187+
then
188+
term_utf8=true
189+
fi
186190
(
187191
cat
188-
if $term
192+
if $term_utf8
189193
then
190194
echo -en " $pretty_symbol "
191195
else

0 commit comments

Comments
 (0)