Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to only use UTF-8 for anything (Client on Win7 64 bit, servers Debian 64bit, su rights for everything). On Stackoverflow I can find many solutions to fix vim for UTF-8 handling. I also have no trouble with my apps iusing PHP and MySQL to only use UTF-8.

But in Putty, as soon as I set "Remote character set" to UTF-8, the terminal output of special chars gets messed up.

On a new server /etc/locale.gen looks as follows:

de_DE ISO-8859-1
de_DE.UTF-8 UTF-8
de_DE.UTF-8@euro UTF-8
de_DE@euro ISO-8859-15

Question: How can I restrict the system to only use utf-8 for everything?

Do I still have to tell every app to use utf-8 individually (eg. vim, mutt, aptitude etc.)?

share|improve this question

migrated from May 16 '12 at 0:05

This question came from our site for professional and enthusiast programmers.

$LANG contains...? – Ignacio Vazquez-Abrams May 15 '12 at 23:57
up vote 3 down vote accepted

Note that /etc/locale.gen only says which locales to make available. It doesn't say which one your session will use as the default. For that, check /etc/default/locale since you are on Debian, or better yet, configure all of this with dpkg-reconfigure locales.

To check which locale your session is using, type locale. $LC_CTYPE overrides $LANG and $LC_ALL overrides everything.

share|improve this answer
Ok, thank you very much. Just for the record, probably obvious for experienced users: simply editing /etc/default/locale or running dpk-reconfigure does not suffice. The user has to make sure to completely end all bash shells before restarting the SSH connection. Now, vim works well and most of the special characters in aptitude are ok (but not all). – Martin May 16 '12 at 1:04

You must log in to answer this question.

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