gnome terminal unicode – Can a Gnome Terminal Profile Use UTF-8 by Default?

gnometerminalunicode

I am on an Ubuntu (I think) system. I don't have root, so I can't change the locale. I want to make my default terminal profile use UTF-8 by default. There should be a way to do this, either in the .gconf/apps/gnome-terminal/ directory somewhere, or in a environment variable, or something. However, I can't seem to find it.

Edit with more details:

In a terminal, I have:

grid-unv55$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
grid-unv55$ gnome-terminal

When try to more a UTF document in that new terminal, I get:

\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd
\noise:bgspeech \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd

Which appears on my screen as dots. (the uffds were a cut and paste. I left the "\noise:bgspeech" in there so you could see that ascii cut and pasted correctly)

Best Answer

I believe that gnome-terminal will Just Work with UTF-8 is enabled in the shell, so all you need to do is enable that. Put

export LANG=en_US.UTF-8

in ~/.bashrc and there you go.


EDIT:

Okay, so, the answer is currently you can't set this. Gnome Terminal follows the current environment's LANG setting and uses the encoding for that as the default. So you need to get LANG to contain UTF-8 before gnome-terminal is launched. Setting this in ~/.bashrc should do it — you'll just need to log out and log in again.

(Note that it's actually better to put this in ~/.bash_profile so you can override it for subshells, but I'm not sure that bash is necessarily run as a login shell as part of setting up the Gnome environment. That's worth testing....)

Related Question