What should I do if the Chinese name of a file uploaded using ftp in centos7 is garbled?

王林
Release: 2020-05-21 15:31:32
Original
4539 people have browsed it

What should I do if the Chinese name of a file uploaded using ftp in centos7 is garbled?

Cause analysis:

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

Solution:

Check the current system language

echo $LANG
Copy after login

It is generally displayed as en_US.UTF-8, which is also the system default language.

Check if there is a Chinese language pack

locale
Copy after login

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
Copy after login

Set the character set

vi /etc/sysconfig/i18n
Copy after login

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 write directly

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

Finally restart linux. Can.

Recommended tutorial: centos tutorial

The above is the detailed content of What should I do if the Chinese name of a file uploaded using ftp in centos7 is garbled?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!