Home >Operation and Maintenance >CentOS >How to solve the problem of Chinese garbled characters in ftp upload files under centos

How to solve the problem of Chinese garbled characters in ftp upload files under centos

王林
王林Original
2020-03-26 15:11:354294browse

How to solve the problem of Chinese garbled characters in ftp upload files under centos

Reason:

Windows system Chinese uses GB2312 encoding, while Linux uses utf-8 encoding.

Solution:

Check if there is a Chinese language pack

locale

(Recommended tutorial: centos tutorial)

If there is no zh_CN.UTF-8 related content, it means that the language pack is not installed. The installation method is as follows:

yum groupinstall chinese-support

It is not enough to have the Chinese language pack, you need to set it

vi /etc/sysconfig/i18n

Press i to switch from insert mode , change en_US.UTF-8 to zh_CN.UTF-8, save with :wq and exit vim editing.

Or directly write

echo "LANG="zh_CN.UTF-8"" >> /etc/sysconfig/i18n
echo "LC_ALL="zh_CN.UTF-8"" >> /etc/sysconfig/i18n

reboot to restart the Linux system.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to solve the problem of Chinese garbled characters in ftp upload files under centos. For more information, please follow other related articles on 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