Linux Common commands: Iconv command

Source: Internet
Author: User

The Iconv command is a common command for file transcoding under Linux, and file transcoding is a frequent operation for students who are using both Windows and Linux systems.

1. Command format:

Iconv [Options ...] [File ...]

2. Command function:

Converts the encoding of a given file.

3. Common parameters:

Input/output format specification:
-F,--from-code= name original text encoding
-T,--to-code= name output encoding

Information:
-L,--list enumeration of all known character sets

Output control:
-C ignores invalid characters from output
-O,--output=file output file
-S,--silent off warning
--verbose Printing Progress Information

-?,--Help gives a list of the systems
--usage gives a brief usage information
-V,--version print program version number

4. Common examples:

Example 1: List the currently supported character encodings:

Command

Example: 2: File transfer utf-8 encoding

Command:

ICONV ABC. sh -o UTF8 #将文件转换成utf8格式

Example 3: File GBK encoding to UTF-8 encoding

Command:

Iconv test.txt-f gbk-t utf-8 -o test2.txt

Example 4: transcode the file file1, and then output the file to Fil2:

Command:

#iconv-  f gbk-t utf-8 file1  - o file2   //Not-O output to standard output.

Example 5:gb2312 encoding to UTF-8 encoding

Command:

Iconv-f gb2312-t utf-8 file1 >-F gb2312-t utf-8 file1-o file2

Linux Common commands: Iconv command

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.