Ubuntu Terminal – Handling Non-English Characters

character encodinggnome-terminallocaleUbuntu

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?

Best Answer

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.