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:
frozen_dude 2013-07-29 20:04:23 +02:00
commit 959d62048f

View file

@ -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