Skip to content

Commit

Permalink
Force locale settings into POSIX
Browse files Browse the repository at this point in the history
In CJK (Chinese, Japanese and Korean) computing,
graphic characters are traditionally classed into fullwidth.
For users who use CJK locales, the colon in the output is ':', rather than ':'.
The script cannot handle these characers, so forcing locale settings into English temporarily can solve this problem.
  • Loading branch information
wh201906 committed Aug 13, 2021
1 parent 9d9c0dd commit be00c47
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pishrink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ if (( EUID != 0 )); then
exit 3
fi

# set locale to POSIX(English) temporarily
# these locale settings only affect the script and its sub processes

export LANGUAGE=POSIX
export LC_ALL=POSIX
export LANG=POSIX


# check selected compression tool is supported and installed
if [[ -n $ziptool ]]; then
if [[ ! " ${ZIPTOOLS[@]} " =~ $ziptool ]]; then
Expand Down

0 comments on commit be00c47

Please sign in to comment.