MacOS self-bringing file encoding format conversion tool

Source: Internet
Author: User

"Command Function"
Iconv is a tool command used by the Linux operating system to convert text encoding formats from one type to another.
"How to use"
Iconv [OPTION ...] [-F ENCODING] [-T ENCODING] [Inputfile ...]

One, control the input and output format options:
1. Input format:
-F ENCODING,--from-code=encoding
2. Output format
-T ENCODING,--to-code=encoding

Second, control conversion problem options:
-C #丢弃不可转换的字符
--unicode-subst=formatstring #对于不可转换的以Unicode Characters Replacement
--byte-subst=formatstring #对于不可转换的以byte替代
--widechar-subst=formatstring #对于不可转换的以wide Characters Replacement

Third, control error output options:
-S,--silent #静默输出, which disables error message output on conversion issues

Iv. Information Output:
-L,--list #列出支持的所有编码格式
--help #显示命令帮助信息并退出
--version #输出版本信息并退出

"Actual Operation"

--list >./infomation.log infomation.log# convert GB2312 encoded file a.html to UTF-F gb2312-t utf-8 a.html >-F gb2312-t BIG5 a.html > b.html # Batch Conversion # first CD to the directory where the files need to be converted, execute the following command to convert the batch file format find C7>sh"iconv-f gb18030-t UTF-8 {} > {}.py"  \; # The above command in the GB18030, if you convert before the code for GB2312, GB18030 instead of GB2312 can be. 

If you feel that my article is useful to you, please feel free to make a reward. Your support will encourage me to continue to create!

MacOS comes with file encoding format conversion tool

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.