6

I have a server with no X, installed with no locales. There is a "C" locale.

I need to:

  • run server scripts (no console involved) to copy, move and gzip files towards local ext4 file-system, which should contain files with special encoding (Czech, Korean, Russian etc.), so the UTF-8 should be enabled.
  • see the file-names when I type commands in the console
  • have possibility to type most of the file-names with special letters, when logged trough ssh.

What should I do to reach that state? Goal is to give complete guide to change locale systemwide (as default).

2
  • 1
    See if thishelps.
    – Mitch
    May 23, 2013 at 7:00
  • L- partially, but still there is default "C" locale involved...
    – Dee
    May 23, 2013 at 7:04

2 Answers 2

8

I have to investigate it deeper and this solution helps me to solve it:

dpkg-reconfigure locales

choose cs_CZ.UTF-8 UTF-8 (default) and/or en_US.UTF-8 UTF-8

apt-get install console-data
dpkg-reconfigure console-data

set pc / qwerty / Czech / Standard / Standard or any other on your choice

dpkg-reconfigure console-setup

set Encoding to use on the console: UTF-8 set Charecter set: Latin2 - central Europe and Romanian, Fixed, 16 or any other on your coice

in file /etc/default/locale set

LANG=cs_CZ.UTF-8
LANGUAGE=cs_CZ.UTF-8
LC_ALL=cs_CZ.UTF-8
LC_CTYPE=cs_CZ.UTF-8

I dont know which steps are necessary, but after this all fonts and especially all ftp transfers and all tar-gzip actions work well.

7

I would generate the English (United States) locale.

sudo locale-gen en_US.UTF-8

The system wide locales are stated in /etc/default/locale in Ubuntu, so give that file the contents:

LANG=en_US.UTF-8
7
  • What about filenames? Still apears as ?????.txt
    – Dee
    May 27, 2013 at 7:14
  • Then are you sure the filenames are UTF-8 encoded? May 28, 2013 at 7:38
  • (Did you reboot?) May 28, 2013 at 7:39
  • @reboot: it is not possible without reboot? Actually, it is a server! And yes, unfortunate rebooted few times.
    – Dee
    May 29, 2013 at 19:14
  • So, are the filenames showing up as ?????.txt UTF-8 encoded? May 31, 2013 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.