Solve the problem of Chinese garbled characters in Linux
Method 1:
Modify the /root/.bash_profile file and add export.GB18030
For other users, the file must also be modified accordingly
When using this method, putty can display Chinese, but the desktop system is in English, and all web pages The Chinese display is still garbled
Method 2:
Modify the /etc/sysconfig/i18n file
#LANG="en_US.UTF-8"
#SUPPORTED="en_US.UTF-8:en_US:en"
#SYSFONT= "latarcyrheb-sun16"
changed to
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.GB18030:zh_CN:zh"
SYSFONT=" lat0- sun16"
SYSFONTACM="8859-15"
When you install centos for the first time, if you choose English, the system will not install the Chinese support package, which will cause the Chinese to be displayed as garbled characters (small boxes)...
I tried various methods online but to no avail.
If you think about it, centos cannot be that stupid. You have to install this and that, and change this and that
Many people say that the vi /etc/sysconfig/i18n file is actually unnecessary.
Finally I found the solution below, thank you to the talented people.
Solution:
The first one:
1.fonts-chinese-3.02-9.6.el5.noarch.rpm. If it cannot be installed, add –force
2.fonts-ISO8859-2-75dpi- 1.0-17.1.noarch.rpm
Second:
yum -y install fonts-chinese
yum -y install fonts-ISO8859-2
Most people don’t do other operations when they get here, resulting in still not being able to get it right Display Chinese.
3. cd /usr/share/fonts/
4.fc-cache -fv #These two steps are the key to success. I believe there are still countless people troubled here
When I logged in to the system today, I found Chinese Garbled characters, solution:
Edit /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
SYSFONT="latarcyrheb-sun16"
Restart the system: After reboot
, edit .bash_profile
and add a line of variables: export.UTF-8
Save and exit
Execute the source .bash_profile command
After that, log out and log in again
More solutions to Linux Chinese garbled problems For related articles, please pay attention to the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Zend Studio 13.0.1
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
