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

What is the cause of linux file name garbled?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

What causes linux file name clutter? Many people don't know much about it. In order to let everyone know more about the reasons for Linux file name garbled, I summarized the following contents for everyone and looked down together.

Linux file name garbled

Upload files to Linux using ftp on windows, Chinese names appear as garbled characters on Linux systems. Although Linux env is set to LANG=en_US. UTF-8, and the native Shell client encoding is set to UTF-8, in the Shell (or accessed via http), it is still garbled.

The reason is that the default Chinese encoding of file names in Windows is GBK. After compression or upload, file names will also be GBK encoding, while the default file name encoding in Linux is UTF8. Due to inconsistent encoding, file names are garbled. To solve this problem, file names need to be transcoded.

yum install convmv convmv -f gbk -t utf-8 -r --notest /home/wwwroot

Common parameters:

-r Recursively process subfolders

-notest actually operates, by default does not actually operate on files

-list shows all supported encodings

- unescape can be escaped, such as %20 into a space

-i Interactive mode (ask each transition to prevent misoperation)

Linux has a number of handy widgets to convert code:

Text content conversion iconv

File name conversion convmv

mp3 tag conversion python-mutagen

The above is a brief introduction to what causes linux file name garbled, of course, the detailed use of the above differences have to be used by everyone to understand. If you want to know more, welcome to pay attention to the industry information channel!

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