Skip to content
Chris Hofstaedtler edited this page Jun 22, 2025 · 6 revisions

Grml Live systems always operate in UTF-8 mode. The Linux Console is UTF-8 enabled, and the default locale(s) are also UTF-8 locales.

Main configuration

grml uses /etc/default/locale as configuration file for environment settings as supported by Debian. If you want to change settings inside this file either adjust it manually with the editor of your choice or use the dialog based frontend named grml-setlang on your grml system. Make sure that your login shell sources the file so the configuration is available within your environment (done via /etc/zsh/zshenv in grml's zsh).

Main troubleshooting within a few seconds

  • Check the environment settings via env | grep -i utf and the keyboard mode on plain console using kbd_mode. Change environment settings global via grml-setlang $LANG (make sure you re-login or at least restart the shell so the environment variables set in /etc/default/locale are being read).
  • If the application still has problems within UTF-8 check whether the application has a commandline switch which en-/disables UTF-8 (like 'screen -U', 'uxterm',...) or if there's a configuration file available which can be adjusted according to your needs and the appropriate mode.
  • Console : before running loadkeys fr, take a look at /usr/share/keymaps/i386/azerty/ to select the correct map. (if you type loadkeys fr, you don't have accents and € ; the correct choice is loadkeys fr-latin9.

Useful software for working with UTF-8

Debian packages

  • console-setup: Setup the font and the keyboard on the console
  • dynafont: Module for konvert package which loads UTF-8 fonts dynamically
  • xutils: provides /usr/bin/luit (a filter that can be run between an arbitrary application and a UTF-8 terminal emulator)

Tools

  • ascii2uni: convert 7-bit ASCII representations to UTF-8 Unicode [package uni2ascii]
  • isutf8: check whether files are valid UTF-8 [package moreutils]
  • uni2ascii: convert UTF-8 Unicode to various 7-bit ASCII representations [package uni2ascii]
  • utf8tolatin1: reads utf-8 encoded text on stdin and writes latin1 (iso8859-1) encoded text on stdout [package o3read]
  • uxterm: X terminal emulator for Unicode (UTF-8) environments [package xterm]
  • vt-is-UTF8: check whether current VT is in UTF8- or byte-mode. [console-tools]
  • iconv: Convert encoding of given files from one encoding to another [package libc6]
  • unicode_start: put the console in Unicode mode [package console-tools]
  • unicode_stop: put the console out of unicode mode (ie. in 8-bit mode) [package console-tools]
  • luit: a filter that can be run between an arbitrary application and a UTF-8 terminal emulator

Tips for working with UTF-8

Shell configuration

grml's zsh configuration provides a function named isutfenv:

isutfenv () {
        case "$LANG $CHARSET $LANGUAGE" in
                (*utf*) return 0 ;;
                (*UTF*) return 0 ;;
                (*) return 1 ;;
        esac
}

You can use this function to check whether you have an UTF-8 environment and work around problematic software via something like:

isutfenv && [ -n "$LANG" ] && alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit mrxvt"

Get real UTF-8 support on plain console

On plain console (tty1, tty2,... not xterm & CO!) grml uses the font Uni3-Terminus16 of Debian package console-terminus. Whereas it works pretty OK for common work on console it is not a real UTF-8 capable font. To get real UTF-8 support on your console use dynafont. Please notice that this slows down your terminal as it loads required fonts dynamically.

The most common of dynafont's usage:

# filterm - dynafont

If you are not using framebuffer, you can use this command:

# filterm - 512bold+dynafont

If the keyboard has ISO-8859-x encoding, then it is possible to run filterm with ISO->UTF 'by-fly' converting, i.e.:

# filterm iso2-UTF8 dynafont

Converting files

Convert files from Unicode / UTF to ISO:

% iconv -c -f utf8 -t iso-8859-15 < utffile > isofile

and vice versa:

% iconv -f iso-8859-15 -t utf8 < isofile > utffile

Test UTF-8 capabilities of terminal

wget http://www.linux-cjk.net/Console/garabik/UTF-8-demo.txt.gz
zcat UTF-8-demo.txt.gz

Further useful resources

Clone this wiki locally