UTF-8 coding for Linux/Windows systems

Source: Internet
Author: User

Copying files from windows to Linux sometimes results in garbled Chinese file names. This problem occurs because the Chinese encoding of Windows file names is GBK by default, in Linux, the default file name encoding is utf8. Due to inconsistent encoding, the file name is garbled. To solve this problem, you need to transcode the file name.

Today, we will introduce a Linux tool: convmv. It can help you complete the conversion of file name encoding, the file name from GBK to UTF-8 encoding, but also from the UTF-8 to GBK.

First, check whether convmv is installed on your system. If it is not installed, use:

Yum-y install convmv installation.

The following describes the usage of convmv:
Convmv-f Source Code-t new encoding [Option] File Name
Common parameters:
-R recursive processing of subfolders
-Notest performs transcoding. Note that by default, the file name is not actually transcoded, but only a test.
-List: displays all supported codes.
-UNESCAP can be used as an escape to convert % 20 to a space.

Now we have a UTF-8 encoded file name, which is converted to GBK encoding. The command is as follows:
Name of the convmv-F UTF-8-t gbk-notest utf8 encoded file

In this way, the "utf8 encoded file name" will be converted to GBK encoding (only the conversion of file name encoding will not change the file content)

The problem of garbled Chinese characters in the Working Copies of Svn in Linux can also be solved. It is a good tool.

Related Article

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.