search
Homephp教程PHP开发How to solve Chinese garbled characters in Linux
How to solve Chinese garbled characters in LinuxDec 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
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)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

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),

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools