Ubuntu: Unable to change gnome-terminal default character encoding



Question:

I have tried everything that I could find on the internet.

$> gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/encoding "en_US.UTF-8"    $> cat /etc/environment  ...  LC_ALL="en_US.UTF-8"    $> locale  LANG=en_US.UTF-8  LC_CTYPE="en_US.UTF-8"  ...  LC_ALL=en_US.UTF-8  

But whenever I open a new gnome-terminal, my powerline symbols still show up as question marks, and Terminal->Set Character Encoding is set to "Current Locale (ANSI3.4-1968)" which I then change to UTF-8 manually and then things are fine.

I have already rebooted the system multiple times!


Solution:1

Newer versions of Gnome terminal use UTF-8 by default, but if you need to enable other encodings you can do so from Edit -> Preferences -> Encodings.enter image description here

Or in dconf at the path /org/gnome/terminal/legacy/encodings. This allows you to change it programatically using gesttings:

gsettings set org.gnome.Terminal.Legacy.Settings encodings "['UTF-8']"  


Solution:2

I was able to get this done! Noting the answer here just in case someone else stumbles upon here with an ancient OS :)

  1. Open gconf-editor. Search for encoding in keys and values. Specifically look for /apps/gnome-terminal/global/active_encodings. And change the value to "UTF-8" (it's a list of strings type, just keep one item in the list)

  2. In your startup file (.bashrc or .cshrc), export environment variable LC_ALL to "en_US.UTF-8" (if you are in the USA) and reboot the system!

I did both the things above. Not sure which one exactly fixes it. Most likely only #1 might be needed. But good idea to set locale properly anyway.

Hope this helps someone. I figured this out by trial and error.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »