#!/bin/sh

TTY="`/usr/bin/tty`"
case "$TTY" in
	/dev/console|/dev/vc*|/dev/tty[0-9]*)
		;;
	*)
		echo "unicode_stop skipped on $TTY"
		exit 0
		;;
esac

# stop unicode
kbd_mode -a
if test -t ; then
	printf '\033%%@'
fi
stty -iutf8

# "dumpkeys | loadkeys --unicode" which is called in "unicode_start"
# cannot be reverted, therefore we have to load the keyboard mapping again
# if it could be sucessfully saved in "unicode_start":

[ ! -r "$HOME/.kbd/.keymap_sv" ] ||
	loadkeys "$HOME/.kbd/.keymap_sv"
