Home php教程 PHP开发 How to solve Chinese garbled characters in Linux

How to solve Chinese garbled characters in Linux

Dec 15, 2016 pm 04:43 PM
linux Chinese garbled code

When you first start using the Linux system, everyone will encounter a problem, that is, when the terminal input command is echoed, the Chinese characters are displayed as garbled characters. Why does such a problem occur? When such a problem occurs, how should we solve it? What's the solution? Today, the editor will tell you about the solution to Chinese garbled characters in Linux.

 The steps are as follows:

 1. How to view and set the system language package in Linux

 1. View the current system language

 After logging in to the Linux system and opening the operating terminal, enter echo $LANG to view the currently used system language. Such as

How to solve Chinese garbled characters in Linux

 2. Check the installed language pack

To see if there is a Chinese language pack, you can enter the locale command in the terminal. If there is zh cn, it means that the Chinese language has been installed

How to solve Chinese garbled characters in Linux

 3. What if there is no Chinese language?

 You can download and install the Chinese language package yum groupinstall chinese-support from the Internet (if you cannot connect to the Internet, download it from other computers, upload it)

How to solve Chinese garbled characters in Linux

 2. How to modify the system language to Chinese

 1. Temporarily change the language

If you only temporarily change the language environment of the Linux system, you can set LANG=language name by inputting it, such as Chinese is

 Zn_CN.UTF-8 (note that this is originally Chinese, I temporarily set it to English

How to solve Chinese garbled characters in Linux

2, Modify the system default language

 The above method is to set the system default language configuration by modifying it

 For example, Vi /etc/sysconfig/i18n (note to restart the system after changing it)

How to solve Chinese garbled characters in Linux

 3. Other precautions

 If you follow If the above method settings and modifications to the Chinese language still don’t work, pay attention to the encoding selected by your link terminal. For example, xshell, select Chinese or UTF8 for the terminal encoding. 4. After setting it up, try again. Check the previous garbled files and you will see that they are displayed in Chinese

How to solve Chinese garbled characters in LinuxThe above is the entire content of the editor’s introduction to the solution to Chinese garbled files in Linux. Such problems are usually caused by the Chinese language package not being installed, or. There is a problem with the default language setting. You can try the above method to solve it!

How to solve Chinese garbled characters in LinuxPlease pay attention to the PHP Chinese website for more related articles on how to solve the Chinese garbled code in Linux!

Statement of this Website
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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)