9

I used to be able to copy&paste (or type if I load respective keyboard layout) any kind of characters (eg. é ö ñ ß و 好) in my console/terminal.

Now I bought a new computer and it does not work any more, only English/ASCII characters (but in other programs, e.g. firefox, it still works).

Distribution: Ubuntu. Terminals tried: gnome-terminal, xterm, konsole.

I tried setting LANG in /etc/environment to en_US.UTF-8 but after reboot echo $LANG still gives C. I also tried setting Character encoding to Unicode(UTF-8) in the gnome-terminal Terminal-menu - without effect.

Question: How can I get a terminal that is able to deal with non-English characters?

0

2 Answers 2

8

Locales are built upon request, because they can take a lot of space. You need to activate the locale by generating the associated data. Ubuntu undoubtedly has a GUI where you can set this, but I don't know where it is offhand. Run this once and for all in a terminal:

locale-gen en_US.UTF-8

You may need to log out and back in for the LANG value not to be sanitized down to C, but you should be able to test right now by running LANG=en_US.UTF-8 gnome-terminal.

By the way, I recommend LC_CTYPE instead of LANG. LC_CTYPE controls the character set only; LANG also affects other locale categories, in particular collation (i.e. character ordering), which can cause trouble occasionally.

2
  • 1
    locale-gen en_US.UTF-8 printed Generating locales... ` en_US.UTF-8... up-to-date` Generation complete., but after LANG=en_US.UTF-8 gnome-terminal in the new terminal it still prints only question marks. Apr 26, 2012 at 13:25
  • From what I can see Ubuntu has adopted the Debian way (/etc/locale.gen) since then.
    – x-yuri
    Jun 10, 2021 at 15:47
2

If you get your locales installed system-wide, try to set up fonts, that can display such a rare characters. There is a problem in Ubuntu in native console, when you have your locales set as UTF8_ru and UTF8_en, you can't type Russian, cause you need to set up Cyrillic fonts for that. So you need UTF8_yourlocale locale set up and appropriate console fonts installed.

And Mozilla, OO and other have their own localization packages, so it gives no effect for system-wide locale settings.

PS: Of course I may be wrong.

1
  • And how to detect which of the fonts support my language? Is fc-list :lang=en correct for this?
    – Suncatcher
    May 20, 2018 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .