aboutsummaryrefslogtreecommitdiffstats
path: root/lang.sh
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-10-04 21:52:15 +0000
committerBill Nottingham <notting@redhat.com>2006-10-04 21:52:15 +0000
commitdf8dbb37bbf199978680058891dfa9bbd5d90b74 (patch)
treeea5e0a9699fe4dad1afd2f11dbe4e9bc727f5cc2 /lang.sh
parentc1b85def2e996813472fb173a0f368a32f144bab (diff)
downloadinitscripts-df8dbb37bbf199978680058891dfa9bbd5d90b74.tar
initscripts-df8dbb37bbf199978680058891dfa9bbd5d90b74.tar.gz
initscripts-df8dbb37bbf199978680058891dfa9bbd5d90b74.tar.bz2
initscripts-df8dbb37bbf199978680058891dfa9bbd5d90b74.tar.xz
initscripts-df8dbb37bbf199978680058891dfa9bbd5d90b74.zip
set iutf8 if appropriate (#186961)
handle non-utf8 locales correctly (#200100)
Diffstat (limited to 'lang.sh')
-rwxr-xr-xlang.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/lang.sh b/lang.sh
index 6b186ce6..e8b1a911 100755
--- a/lang.sh
+++ b/lang.sh
@@ -40,11 +40,13 @@ if [ "$sourced" = 1 ]; then
[ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
[ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
[ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET
+
+ consoletype=$(/sbin/consoletype)
if [ -n "$CHARSET" ]; then
case $CHARSET in
8859-1|8859-2|8859-5|8859-15|koi*)
- if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt" ]; then
+ if [ "$TERM" = "linux" -a "$consoletype" = "vt" ]; then
echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
fi
;;
@@ -52,7 +54,7 @@ if [ "$sourced" = 1 ]; then
elif [ -n "$SYSFONTACM" ]; then
case $SYSFONTACM in
iso01*|iso02*|iso05*|iso15*|koi*|latin2-ucw*)
- if [ "$TERM" = "linux" -a "`/sbin/consoletype`" = "vt" ]; then
+ if [ "$TERM" = "linux" -a "$consoletype" = "vt" ]; then
echo -n -e '\033(K' 2>/dev/null > /proc/$$/fd/0
fi
;;
@@ -61,12 +63,25 @@ if [ "$sourced" = 1 ]; then
if [ -n "$LANG" ]; then
case $LANG in
*.utf8*|*.UTF-8*)
+ if [ "$consoletype" = "vt" -o "$consoletype" = "pty" ]; then
+ stty iutf8
+ fi
if [ "$TERM" = "linux" ]; then
- if [ "`/sbin/consoletype`" = "vt" ]; then
+ if [ "$consoletype" = "vt" ]; then
[ -x /bin/unicode_start ] && /sbin/consoletype fg && /bin/unicode_start $SYSFONT $SYSFONTACM
fi
fi
;;
+ *)
+ if [ "$consoletype" = "vt" -o "$consoletype" = "pty" ]; then
+ stty -iutf8
+ fi
+ if [ "$TERM" = "linux" ]; then
+ if [ "$consoletype" = "vt" ]; then
+ [ -x /bin/unicode_stop ] && /sbin/consoletype fg && /bin/unicode_stop
+ fi
+ fi
+ ;;
esac
fi