/********************************************************************* * 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;