Get the App
SLTechnology News&Howtos  ›  Servers  › 

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

Shulou Source: shulou.com Published: 2022-06-03 07:53:03 09月21日 Update

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!

Tags: File file name garbled code coding method system processing medium problem content Chinese wrong consistent reason parameter name client client that is commonly used Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info Huawei Apple vpn