zoukankan      html  css  js  c++  java
  • Mac自带编码转换工具iconv

    iconv --help

    Usage: iconv [OPTION...] [-f ENCODING] [-t ENCODING] [INPUTFILE...]
    or:    iconv -l
    
    Converts text from one encoding to another encoding.
    
    Options controlling the input and output format:
      -f ENCODING, --from-code=ENCODING
                                  the encoding of the input  #要准换的文件
      -t ENCODING, --to-code=ENCODING
                                  the encoding of the output
    
    Options controlling conversion problems:
      -c                          discard unconvertible characters . # 忽略无法识别的错误参数
      --unicode-subst=FORMATSTRING
                                  substitution for unconvertible Unicode characters
      --byte-subst=FORMATSTRING   substitution for unconvertible bytes
      --widechar-subst=FORMATSTRING
                                  substitution for unconvertible wide characters
    
    Options controlling error output:
      -s, --silent                suppress error messages about conversion problems
    
    Informative output:
      -l, --list                  list the supported encodings
      --help                      display this help and exit
      --version                   output version information and exit
    
    Report bugs to <bug-gnu-libiconv@gnu.org>.
    

      

     示例:

    iconv -f utf-8 -t gb2312 -c a.txt > c.txt

    转换成功的文件,在terminal中用 open . 命令打开当前文件夹,将转换的c.txt扔到浏览器上,查看转换编码结果。

  • 相关阅读:
    从jdbc到分层的飞跃
    第二章 变量和数据类型
    s1300新学期伊始的我们
    选择结构总结
    第四章 选择结构(二) Switch结构
    第三章 选择结构(一)
    第二章 变量、数据类型和运算符
    使用Java理解程序逻辑 第1章 初识Java 基本部分
    ES命令基础
    Spring MVC拦截器
  • 原文地址:https://www.cnblogs.com/zoe233/p/8043524.html
Copyright © 2011-2022 走看看