There seems to be a bug in Ubuntu 12.04 with setting locales for users, the root locales are set but this doesn’t seem to filter down to individual user accounts. This might not be a problem for you until you ssh into your server. And by the way this seems to be affecting Debian variants, I haven’t checked Debian but my Raspberry Pi which are running Raspbian, a variant of Debian, are affected too. This bug does not affect the desktop version of this OS, only if installed on server (minimal install)

Now I use three different OS to ssh with windows Putty, OSX terminal and a Linux terminal and I want the same locale encoding on all three.

As a programmer I like to use UTF-8 encoding for my HTML, PHP, JS and CSS files so this is the encoding default for all my systems.

I only really noticed this when I was using ssh on my iPad and Midnight Commander on the server and the terminal had strange letters where lines should be but when I used mc as root everything was the way it should be! So I knew I had a problem so I googled for a solution and tried several, which didn’t work, and come to the right one eventually.

So with that said here is how I fixed it:

First we need to see what locale settings the user has set so in a terminal enter

If this shows what is below then you have this bug.

Now I use British English so in ‘~/.bashrc’, add at the bottom

Now this has to be done for ever user so put this code in ‘/etc/skel/.bashrc’ then every new user will have this default encoding set.

For more info on locales

If anyone has another way that works please feel free to post it.