By enabling a locale using UTF-8 character encoding, the system can understand and display each of the 1112064 characters in the Unicode character set, instead of just US ASCII as its default with LANG=C.
- For a list of available UTF-8 locale on your computer.
locale -a | grep UTF-8
Note:
en_US.UTF-8is American- The
LANG=xx_YY.ZZZZenvironment variable sets the system locale to- language code
xx, - country code
YY, and - character encoding
ZZZZ
- language code
Language and country code affect default application language, number formatting, date and time formatting, string collation, currency settings, and more.
- Enable UTF-8 by opening the
vi /etc/login.conffile.
| Already in file | Add below in file |
|---|---|
:pseudoterminals=unlimited:\ |
:charset=UTF-8:\ |
:priority=0:\ |
:lang=en_US.UTF-8: |
:ignoretime@:\ |
|
:umask=022: |
-
Changes made in step-2 must be rebuilt in the login database by
cap_mkdb /etc/login.conf -
Specify this new locale for non login uses with
vi /etc/profileand adding
LANG=en_US.UTF-8; [this will export LANG]
CHARSET=UTF-8; [this will export CHARSET]
GDM_LANG=en_US.UTF-8; [this will export GDM_LANG]
- Check changes made in step-4 (might require
reboot) with
locale
Output should look something like
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8