Table of Contents

UTF-8 at grml

General information

Starting with version 1.0 grml uses UTF-8 as default encoding. The main reason for this change is that all the other major Linux distributions (including Debian) use UTF-8 as well nowadays.

UTF-8 on grml

Bootoptions

By default grml uses the UTF-8 encoding. To disable UTF-8 as default encoding just boot using:

grml lang=$LANG-iso

… where $LANG is the corresponding language. For example use 'lang=de-iso' to use german keyboard and ISO8859-15 encoding.

Main configuration

grml uses /etc/default/locale as configuration file for environment settings as suggested and 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

Useful software for working with UTF-8

Debian packages

Tools

Software known to have problems with UTF-8

You can find software within grml's package selection that does not (yet) support UTF-8/unicode. If you find software having problems within UTF-8 environment not yet listed here please feel free to extend the list.

Notice: software known to cause problems with UTF-8 is started within a ISO8859-15 environment plus the luit wrapper on grml, see the following shell configuration part for details.

Tipps when 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"

Some further snippets from grml's zsh configuration:

  alias term2iso="echo 'Setting terminal to iso mode' ; echo -e '^[%@'"
  alias term2utf="echo 'Setting terminal to utf-8 mode'; echo -e '^[%G'"

  alias utf2iso='if isutfenv ; then
   for ENV in `env | grep UTF` ; do
       eval export "$(echo $ENV | sed 's/UTF-8/iso885915/')"
   done
   fi'
  alias iso2utf='if isutfenv ; then
   for ENV in `env | grep '\.iso'` ; do
       eval export "$(echo $ENV | sed 's/iso.*/UTF-8/')"
   done
   fi'

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

Running terminal in ISO mode on a UTF-8 system

You might notice problems with the terminal, if your local system uses UTF-8 whereas the remote system you're connecting to (for example via SSH) uses ISO mode (iso8859-1[5] for example). To get an appropriate terminal running X on your local system just invoke uxterm (a wrapper around the xterm(1) program that invokes the latter program with the 'UXTerm' X resource class set if necessary). If you want to get a plain ISO terminal even if your local system and its environment uses UTF-8 invoke /usr/bin/iso-term on your grml system. iso-term is a simple wrapper script that changes all the UTF-8 stuff inside your environment (check via running 'env') to iso885915 and invokes x-terminal-emulator then. finally you can also invoke your applications via the luit wrapper, for example via 'LANG=de_DE.iso88591 luit zsh'.

Further useful ressources