Conversion of character set encoding for folders and files under Linux

Source: Internet
Author: User
Tags ftp client

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.