The default Simplified Chinese character encoding on Windows is GBK, while Linux is UTF-8 (The description here doesn't seem to be accurate, and the character encoding and character set should not be the same, not clear.).
To view the file encoding:(the eNCA package may not be installed by default and can be installed with commands such as Apt-get install eNCA or yum install eNCA):
- $ enca filename
GB2312 encoded file output:
- Simplified Chinese national standard; GB2312
- CRLF Line Terminators
Convert file encoding to UTF-8:
- $ iconv-f gb2312-t UTF-8 filename > NewFileName
- Note: Filename and newfilename do not have to be the same otherwise empty.
at this point, use the eNCA command to view newfilename, output:
- Universal Transformation Format 8 bits; UTF-8
- CRLF Line Terminators
The character encoding of the Linux Shell command transformation file