]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Enhance guessing if UTF-8 or ISO8859-1 encoding should be used
authorAlexander Barton <alex@barton.de>
Tue, 18 Dec 2012 20:16:04 +0000 (21:16 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 18 Dec 2012 20:16:04 +0000 (21:16 +0100)
sys/profile

index 8afa7ca1036575b2f609ab3c7853ff88bd1d4fd2..a2def557ed0909148fe4bef5f2d1d5e3bdd02c17 100644 (file)
@@ -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}"