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).

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

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
  • What about filenames? Still apears as ?????.txt – Dee May 27 '13 at 7:14
  • Then are you sure the filenames are UTF-8 encoded? – Gunnar Hjalmarsson May 28 '13 at 7:38
  • (Did you reboot?) – Gunnar Hjalmarsson May 28 '13 at 7:39
  • @reboot: it is not possible without reboot? Actually, it is a server! And yes, unfortunate rebooted few times. – Dee May 29 '13 at 19:14
  • So, are the filenames showing up as ?????.txt UTF-8 encoded? – Gunnar Hjalmarsson May 31 '13 at 6:01
up vote 4 down vote accepted

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.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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