Gnome Terminal and Character Encodings
Since upgrading to GNOME 2.14, I have been revisited by an annoying problem with gnome-terminal. Gnome-terminal sets your character encoding to being the same as your locale by default, which unfortunately was being detected as ANSI_X3.4-1968, while I had my $LANG set to en_GB.UTF-8 in my ~/.bash_profile. The reason it wasn’t being detected was because nothing between logging in and starting gnome-terminal looked at that file, so gnome-terminal thought the locale was C.
The result was corrupt display when programs attempted to display unicode characters. I could fix it by changing the character encoding using the menu, but I’d have to do this for every tab, which quickly becomes annoying. Time to find a fix.
Turns out that you need to tell gdm to set the right locale, which you can do by configuring ~/.dmrc. Mine now looks like:
[Desktop]
Session=gnome
Language=en_GB.UTF-8
Obviously, the important section is the Language line. You need to set it to a locale that exists on your system, which you can find using locale -a. Once you’ve set that and logged in again, everything should be working correctly.
Filed under computing
1 comment
Comments are closed. These are preserved from the original site.
Actually I am not sure how gdm is supposed to make sure your .profile/.bash_profile/.login/.zlogin/.zprofile (depending on your shell) gets read. I have code in my .xsession that detects whether it has been done incorrectly and restarts itself under a login shell (by using the shell's -l option) if so but I'm sure there's a better way.