From 7b01a4be1c5facacbd02081bf8fc704dd1bd79f4 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 23 Apr 2014 20:05:25 +0200 Subject: [PATCH] Correctly detect encoding from "LC_CTYPE" and "LANG" --- sys/profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/profile b/sys/profile index 0943d22..a606169 100644 --- a/sys/profile +++ b/sys/profile @@ -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 -- 2.39.2