Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't my terminal output unicode characters properly?

For example, my terminal does this:

$ echo -e "\xE2\x98\xA0" ��� 

I expect it to do this:

$ echo -e "\xE2\x98\xA0" ☠ 

Why? How do I make my terminal output the proper unicode symbols?

I'm using Gnome 3's Terminal on Arch Linux.

The output of locale shows:

LANG=C LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_PAPER="C" LC_NAME="C" LC_ADDRESS="C" LC_TELEPHONE="C" LC_MEASUREMENT="C" LC_IDENTIFICATION="C" LC_ALL= 
like image 917
trusktr Avatar asked Sep 29 '12 04:09

trusktr


People also ask

Why do some Unicode characters not show up?

If you are unable to read some Unicode characters in your browser, it may be because your system is not properly configured. Here are some basic instructions for doing that. There are two basic steps: Install fonts that cover the characters you need.

How do I use Unicode characters in terminal?

Press and hold the Left Ctrl and Shift keys and hit the U key. You should see the underscored u under the cursor. Type then the Unicode code of the desired character and press Enter. Voila!

How do I enable Unicode?

To insert a Unicode character, type the character code, press ALT, and then press X. For example, to type a dollar symbol ($), type 0024, press ALT, and then press X.


1 Answers

I figured it out. I had to make sure I set LANGUAGE="en_US.UTF-8" in /etc/rc.conf and LANG="en_US.UTF-8" in /etc/locale.conf, then logged out and logged back in and it worked. My terminal displays unicode properly now.

like image 71
trusktr Avatar answered Oct 14 '22 15:10

trusktr