From: Alexander Barton Date: Tue, 18 Dec 2012 20:16:04 +0000 (+0100) Subject: Enhance guessing if UTF-8 or ISO8859-1 encoding should be used X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a14bc5f668f8e7591de87bc42ae311acc6da52ad;p=ConfigScripts.git Enhance guessing if UTF-8 or ISO8859-1 encoding should be used --- diff --git a/sys/profile b/sys/profile index 8afa7ca..a2def55 100644 --- a/sys/profile +++ b/sys/profile @@ -14,8 +14,16 @@ export PROFILEREAD export UID # Indicates LC_CTYPE an UTF-8 terminal? -[ -n "$LC_CTYPE" ] \ - && LC_encoding="${LC_CTYPE#*.}" || LC_encoding="ISO8859-1" +if [ -n "$LC_CTYPE" ]; then + LC_encoding="${LC_CTYPE#*.}" +else + case "$TERM" in + "xterm-"*) + LC_encoding="UTF-8"; ;; + *) + LC_encoding="ISO8859-1" + esac +fi # Set locale if it is not set or doesn't contain a dot: [ "$LANG" = "${LANG#*.}" -a "$LANG" != "C" ] \ && export LANG="${LANG:-de_DE}.${LC_encoding}"