]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Correctly detect encoding from "LC_CTYPE" and "LANG"
authorAlexander Barton <alex@barton.de>
Wed, 23 Apr 2014 18:05:25 +0000 (20:05 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 23 Apr 2014 18:05:25 +0000 (20:05 +0200)
sys/profile

index 0943d22768eb8d16a50fa942a8ab4ea2fe7865ce..a606169774bd8586d15c9ed400f1d010c376422c 100644 (file)
@@ -18,9 +18,9 @@ fi
 # Does LC_CTYPE or LANG indicate an UTF-8 terminal?
 LC_encoding=""
 if [ -n "$LC_CTYPE" ]; then
-       LC_encoding="${LC_CTYPE#*.}"
+       LC_encoding=`echo "$LC_CTYPE" | cut -d. -f2- -s`
 elif [ -n "$LANG" ]; then
-       LC_encoding="${LANG#*.}"
+       LC_encoding=`echo "$LANG" | cut -d. -f2- -s`
 fi
 if [ -z "$LC_encoding" ]; then
        case "$TERM" in