Saturday, February 15, 2014

National Characterset for Ubuntu Console

About Locales

It is not an in-depth guide but rather a briefing which I used to write down the most essential things about customizing locales.
Despite the post is focused on Polish locale, you might find it helpful because the procedure is similar for other languages.

Steps

Install possible missing packages. In the new Ubuntu release it is as simple as:

aptitude install language-pack-pl

Which automatically generates appropriate locales.

In older Ubuntu versions:

   aptitude install locale
   aptitude install localedef

lenny: apt-cache install locales-all

 X11

After "locale/language-pack" packages are installed and assuming proper fonts are already here, national characters should be visible without any issue in xterm and similar applications. However it still needs a proper keyboard layout.

For Redhat (Oracle Enterprise Linux) 6.4 it is as simple as going to System -> Preferences -> Keyboard -> Layouts and choosing Polish (or other) layout there, optionally making it the default one.

For Ubuntu 13.10: System Settings -> Text Entry -> Input source to use: pick your national keyboard here, make it default if you prefer.

Console Specific

vim /etc/default/console-setup:

CHARMAP=UTF-8
CODESET=Uni2
XKBLAYOUT=pl (can be in /etc/default/keyboard)

setupcon -v

Locale General

  1. locale (examines standard environment settings for locales)
  2. locale -a (examines what choices are possible)
  3. If there is not Polish locales: locale-gen pl_PL.UTF8 (checkout /etc/locale.gen)
  4. Files:
    • /etc/default/locale - global system locale definition
    • /etc/environment

References

  1. Ubuntu Locale Help

No comments:

Post a Comment