Web site has some courseware resources, courseware resources are uploaded from Windows to Linux Server, under Windows folder encoding method is GBK, and the browser default encoding mode is UTF-8 (server default encoding is also UTF-8), so, led to similar http://xxxx//Resources/Beijing Normal University/Junior language/Eight grade/book synthesis/green. ppt Such a domain name cannot be accessed, prompting to find a resource.
Workaround : Use the convmv tool to recode the names of all files under the resources directory using Utf-8
Download Convmv:wget https://www.j3e.de/linux/convmv/convmv-1.15.tar.gz
Note: If the FTP client accesses the resource, if it encounters garbled characters, please verify that the client encoding method and server are consistent
Make clean
Make install
./convmv-f gb2312-t UTF-8-R--notest/resources/*
The above describes how to modify the directory name code under Linux, and then expand the file content to change the encoding method
1. Convert file encoding directly into Vim, such as converting a file to Utf-8 format
: Set Fileencoding=utf-8
2. Iconv conversion, the ICONV command format is as follows:
Iconv-f ENCODING-T Encoding Inputfile
such as converting a UTF-8 encoded file into a GBK encoding.
Iconv-f gbk-t UTF-8 file1-o file2
Conversion of character set encoding for folders and files under Linux