Ubuntu display Chinese Characters - Encoding Issue

9,708

Seems like your system doesn't have the locale defined. You should set it to en_GB.UTF-8 or whichever locale you consider appropriate.


Viewing the current locale settings:

locale -a

Setting the locale to en_GB.UTF-8:

sudo locale-gen en_GB.UTF-8
sudo update-locale LANG=en_GB.UTF-8

Editing your locale settings:

If you need to adjust manually any locale setting, you can edit /etc/default/locale with your favorite text editor. This should not be required in your case.

Share:
9,708

Related videos on Youtube

user3066279
Author by

user3066279

Updated on September 18, 2022

Comments

  • user3066279
    user3066279 over 1 year

    I'm running a Ubuntu 14.04 32 bit. I'm facing a strange problem displaying Chinese characters in terminal, files, MySQL terminal etc. The Chinese characters are displaying as ?????. After some googling, I found out running locale was returning LC_ALL empty. When I export LC_ALL to en_GB.UTF-8, the ????? are replaced to some special characters like diamond symbols.

    But when I connect to this system over SSH(from another Ubuntu PC), I'm able to view Chinese characters properly after setting LC_ALL. Without LC_ALL, the Chinese characters as displayed as ?????.

    I have another system running similar environment in which I'm able to display Chinese characters without exporting LC_ALL. Moreover, locale returns LC_ALL as empty.

    I assume there could be some encoding difference between the systems or maybe some fonts may not be available.

    Is there anything I'm missing or any packages missing in this problematic PC? How can I make sure the locales are same between the systems ? Also, what are the packages that are required to display Chinese characters or other foreign characters in Ubuntu?

  • 0x2b3bfa0
    0x2b3bfa0 over 5 years
    Sorry, I shall be more explicit. Please check the edited answer. By the way: welcome to AskUbuntu!