Skip to content

Instantly share code, notes, and snippets.

@pbrisbin
Created November 10, 2010 01:03
Show Gist options
  • Select an option

  • Save pbrisbin/670165 to your computer and use it in GitHub Desktop.

Select an option

Save pbrisbin/670165 to your computer and use it in GitHub Desktop.
if echo "$LOCALE" | /bin/grep -qi utf ; then
stat_busy "Setting Consoles to UTF-8 mode"
# UTF-8 consoles are default since 2.6.24 kernel
# this code is needed not only for older kernels,
# but also when user has set vt.default_utf8=0 but LOCALE is *.UTF-8.
for i in /dev/tty[0-9]*; do
/usr/bin/kbd_mode -u < ${i}
printf "\033%%G" > ${i}
done
# the $CONSOLE check helps us avoid this when running scripts from cron
echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033%%G"; fi' >>/etc/profile.d/locale.sh
stat_done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment