search
Homephp教程PHP开发Four steps to solve the problem of Chinese garbled characters in Linux system

When using the CentOS system, you may encounter the English CentOS system during installation. In this case, the CentOS system is installed by default (i.e. English). After the installation is completed, various Chinese garbled characters appear. So, how do we solve this problem.

1. When accessing g.cn on CentOS system, Chinese garbled characters were found.

So I used the previous method: yum -y install fonts-chinese
After installing the CentOS system, Chinese fonts still cannot be displayed. I use gedit to edit the source code, and the Chinese comments are also garbled.

Later, I finally found the following method to solve the problem, which requires two Chinese support packages:
fonts-chinese-3.02-12.el5.noarch.rpm
ftp://ftp.muug.mb.ca/mirror/centos/ 5.4/os/x86_64/CentOS/fonts-chinese-3.02-12.el5.noarch.rpm


fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
ftp://ftp.muug.mb. ca/mirror/centos/5.4/os/x86_64/CentOS/fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm
One is Chinese fonts and the other is font display package.

After downloading, install on the command line:
#rpm -ivh XXXX (XXXX represents the full name of the two packages above, don’t you know how to use rpm?)
After the CentOS system is installed, just restart.

2. Terminal and gedit display garbled characters

#vi /etc/sysconfig/i18n
Change LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
Modify the original content to
LANG="zh_CN.GB18030 "
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"

Use yum install Chinese fonts
#yum install fonts-chinese.noarch
system -> logout log out
and log in again to the CentOS system, you will find that all interfaces have been changed from English to Chinese. Enter the date command in the terminal to test
#date

3. Solution to garbled Chinese display in ssh and telnet terminals (CentOS 5.3)

#vi /etc/sysconfig/i18n
Change the original content LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
Modified to
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF -8:en_US:en"
SYSFONT="lat0-sun16"

Use yum to install Chinese fonts
#yum install fonts-chinese.noarch
Disconnect ssh and reconnect
Enter the date command in the terminal to test
#date

4. Using the Chinese input method in CentOS system 5.3

My previous method was to install the Penguin version, see the next page. Here, there is an easier one, just use yum to install SCIM.
Command line input:
#yum install scim
#yum install scim-pinyin
Restart X (press Ctrl+Alt+Backpace) or log out (logout).

Okay, you can enter Chinese. The problem of Chinese garbled characters in CentOS system is solved in this way.

For more four-step solutions to the problem of Chinese garbled characters in Linux systems, please pay attention to the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SecLists

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.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.