Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of dealing with Chinese File name garbled in linux system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Today, the editor to share with you is the linux system Chinese file name garbled handling methods, many people do not understand, today, in order to let you know more about the linux system Chinese file name garbled handling methods, so give you a summary of the following content, let's look down. I'm sure you'll get something.

Question:

Use ftp to upload files to Linux on windows, and the Chinese name appears as garbled in the Linux system. Although the env of Linux is set to LANG=en_US.UTF-8, and the local Shell client encoding is also set to UTF-8, it is still garbled in Shell (or accessed through http).

Reason:

The Chinese coding of the file name of Windows defaults to GBK. After compression or upload, the file name will still be encoded by GBK, while the default file name in Linux will be encoded as UTF8. The problem of garbled file name is caused by inconsistent encoding. To solve this problem, you need to transcode the file name.

Solution:

Yum install convmvconvmv-f gbk-t utf-8-r-notest / home/ files to be operated

Common parameters:

-r Recursive processing subfolders

-notest actually operates. By default, it does not perform real operations on files.

-list displays all supported encodings

-unescap can do some escaping, such as turning% 20 into a space

-I interaction mode (ask each conversion to prevent misoperation)

These are the details of the handling of garbled Chinese file names in the linux system. Do you have anything to gain after reading it? If you want to know more, welcome to the industry information!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report