Setting locales so that terminal in Mac OS would display Unicode character

locale

Output:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

We can set the LANG variable by

export LANG=en_US.UTF-8

Or you can also add that line into the file ~/.bash_profile, and then source ~/.bash_profile

Different ways to output Christmas tree [from fileformat] in terminal:

perl -CS -E 'say "\x{1F384}"'
echo -e "\xF0\x9F\x8E\x84"

To display Christmas tree in git log

Turn out that because less program is not up-to-date in Mac OS. Hence we need to update it.

http://www.recursion.org/2016/6/19/displaying-emoji-in-git-log

 

Advertisements