mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Fix for bad locale entry, LANG is a colon-separated list of prefered locales, LC_CTYPE is single entry, thus we need to remove all but one entry. There is also no idea setting it if it is already set.
This commit is contained in:
parent
5fcb6e1263
commit
959d62048f
1 changed files with 11 additions and 1 deletions
12
lib/misc.zsh
12
lib/misc.zsh
|
|
@ -12,4 +12,14 @@ setopt long_list_jobs
|
|||
export PAGER="less"
|
||||
export LESS="-R"
|
||||
|
||||
export LC_CTYPE=$LANG
|
||||
## how to interpret text characters
|
||||
if [[ -z "$LC_CTYPE" -a -z "$LC_ALL" ]]; then # only define if undefined
|
||||
export LC_CTYPE=${LANG%%:*} # pick the first entry from LANG
|
||||
[[ -z "$LC_CTYPE" ]] && \
|
||||
export LC_CTYPE=`locale -a | grep en_US.utf8 | head -1`
|
||||
[[ -z "$LC_CTYPE" ]] && \
|
||||
export LC_CTYPE=`locale -a | grep en_US | head -1`
|
||||
[[ -z "$LC_CTYPE" ]] && \
|
||||
export LC_CTYPE=C # default to internal encoding.
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue