In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "character set encoding conversion of folders and files under linux". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn the "character set encoding conversion of folders and files under linux" together!
Some courseware resources on the website are transferred from windows to Linux server. Under windows, the folder encoding mode is GBK, while the browser default encoding mode is UTF-8 (the server default encoding is also UTF-8). In this way, domain names such as http://xxxx/Resources/Beijing Normal University/Junior High School Chinese/Eighth Grade/This Book Comprehensive/Green.ppt cannot be accessed, indicating that resources cannot be found.
Workaround: Use convmv to re-encode all file names in the Resources directory using utf-8
Download convmv: wget https://www.j3e.de/linux/convmv/convmv-1.15.tar.gz
Note: If you encounter random code when accessing resources with ftp client, please also verify whether the client encoding method is consistent with that of the server.
make clean
make install
./ convmv -f GB2312 -t UTF-8 -r --notest /Resources/*
The above describes how to modify the directory name encoding under linux, and then expand the file content to change the encoding method
1. Convert file encoding directly in Vim, such as converting a file to utf-8 format
:set fileencoding=utf-8
2. iconv conversion, iconv command format is as follows:
iconv -f encoding -t encoding inputfile
For example, convert a UTF-8 encoded file to GBK encoding
iconv -f GBK -t UTF-8 file1 -o file2
Thank you for reading, the above is the "linux folder and file character set encoding conversion" content, after learning this article, I believe we have a deeper understanding of the linux folder and file character set encoding conversion problem, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.