Home > Article > System Tutorial > Introduction to iconv command under CentOS
iconv -f encoding [-t encoding] [inputfile]...
[Function]
Convert the contents of a given file from one encoding to another.
[describe]
-f encoding: Convert characters from encoding encoding.
-t encoding: Convert characters to encoding.
-l: List the known set of encoded characters
-o file: Specify the output file
-c: Ignore illegal characters in the output
-s: Suppress warning messages, but not error messages
--verbose: display progress information
The legal characters that can be specified by -f and -t are listed in the command with the -l option.
[Example]
*List currently supported character encodings:
[quietheart@lv-k test]$iconv -l
*Transcode the file file1 and output the converted file to fil2:
[quietheart@lv-k test]$iconv file1 -f EUC-JP-MS -t UTF-8 -o file2
Here, without -o, the output will be sent to standard output.
The above is the detailed content of Introduction to iconv command under CentOS. For more information, please follow other related articles on the PHP Chinese website!