/usr/bin/unicode_stop is in console-tools 1:0.2.3dbs-65.1ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #!/bin/sh
# stop unicode
if [ ! -e /proc/self/fd/0 ] ; then
echo "Not setting UTF-8 mode; cannot check console type." >&2
echo " please ensure /proc is mounted." >&2
exit 1
fi
readlink /proc/self/fd/0 | grep -q -e /dev/vc -e '/dev/tty[^p]' -e /dev/console
if [ $? -eq 1 ]; then
echo "Not a virtual terminal : Not setting UTF-8 mode." >&2
exit 1
fi
if [ -n "$previous" ] && [ -n "$runlevel" ] || [ "$runlevel" = "S" ]; then
RUN_FROM_INIT="yes"
fi
if ! /usr/bin/vt-is-UTF8 --quiet && [ "$RUN_FROM_INIT" != "yes" ]; then
echo "unicode_stop: Already in byte-mode" >&2
exit 0
fi
kbd_mode -a
# set DEVICE_PREFIX depending on devfs/udev
if [ -d /dev/vc ]; then
DEVICE_PREFIX="/dev/vc/"
else
DEVICE_PREFIX="/dev/tty"
fi
NUM=`fgconsole --next-available`
NUM=`expr ${NUM} - 1`
# Cope with being called in S mode before getty starts the remaining
# VTs:
[ $NUM -eq 1 ] && NUM=6
for vc in `seq 1 ${NUM}`
do
/bin/echo -n -e '\033%@' > ${DEVICE_PREFIX}${vc}
done
|