Character encoding and conversion tools for GNU Linux files

Source: Internet
Author: User

/********************************************************************* * Author:samson * date:07/03/2014 * Test PL Atform: * 3.11.0-12-generic #19-ubuntu * GNU bash, version 4.2.45 * **************************** ***************************************/

To see how the current file is encoded in GNU Linux:

You can open this file with vim and enter it in control mode

: Set fileencoding can view the character encoding format of the current file, which appears below the Vim window:

Fileencoding=utf-8
The upstream means that the character encoding of this file is utf-8;



So how do you convert the character encoding of a file?
Can be processed using the Iconv command.
Iconv-convert encoding of given files from one encoding to another
The format is generally:
Iconv-f utf8-t UTF-16 foo_in.txt > Foo_out.txt
This means that the UTF8 character encoded file is converted to the format of the UTF16 character encoding format, which can be used to view the format of the converted file, and the character encoded by the test input is:

Fileencoding=utf-16le


PS: You can use the Iconv--list command to view Iconv supported character encoding format;

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.