Convert file encoding

Source: Internet
Author: User
Convert file encoding-general Linux technology-Linux technology and application information. For more information, see. After I completely switched my daily system to Ubuntu Linux, garbled characters occurred when I opened the files that were previously retained from Windows. In fact, this problem is very common, most of which is caused by encoding. To solve the Garbled text, we need to convert the file from one encoding to another. At this time, the command line program iconv will be very useful.

Iconv is a file encoding and Conversion Tool. Its basic usage is as follows:

Iconv-f original encoding-t destination encoding file to be converted-o converted file

For example, if we want to convert the sample.txtfile gb2312to ipv8and export it to the converted.txt file, run the following command:

Iconv-f gb2312-t UTF-8 sample.txt-o converted.txt

If you want to know which encoding iconv supports conversion, you can use the-l option to view the Code:

Iconv-l
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.