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扔到浏览器上,查看转换编码结果。

Mac自带编码转换工具iconv的更多相关文章

  1. ubuntu下编码转换工具

    ubuntu打开windows下的txt或者代码文件,经常会出现乱码, ubuntu自带一种转换工具,是命令行的,下面提供一种最简单的方法进行转换 比如要转换的文件为1.txt,进入1.txt的目录 ...

  2. php 字符编码转换函数 iconv mb_convert_encoding比较

    在使用PHP处理字符串时,我们经常会碰到字符编码转换的问题,你碰到过iconv转换失败吗? 发现问题时,网上搜了搜,才发现iconv原来有bug ,碰到一些生僻字就会无法转换,当然了配置第二个参数时, ...

  3. Mac OS X 系统下自带的文本文件格式转换工具iconv

    1. utf-8 转 GBK的方法 在mac bash 中直接运行 iconv -f UTF-8 -t GBK test_utf8.txt > test_gbk.txt 举例:创建测试文件 ec ...

  4. PHP字符编码转换库iconv的一个细节

    先来看代码 <?php $charset = 'GBK'; $str = '中华人民共和国中华人民共和国中华人民共和国中华人民共和国'; ; $str2 = iconv('UTF-8', $ch ...

  5. 利器: Mac自带的图片工具Sips

    Sips是Mac提供的一个处理图片的命令行工具,与Photoshop这种重量级选手相比,自然功能上要差很多.不过话说回来如大小裁剪.图片翻转和旋转这些日常小功能其实也不必非得动用Photoshop这样 ...

  6. AllInOneConveter——编码转换工具

    一.Url编码解码 二.Base64编码解码 三.\u形式Unicode和汉互转 四.Md5加密 五.源代码 https://github.com/FrankFan/AllInOneConverter ...

  7. Mac下文件编码转换

    参见:http://bbs.feng.com/read-htm-tid-107633.html 使用: sudo find *.txt -exec sh -c "iconv -f GB180 ...

  8. 使用vbs脚本进行批量编码转换

    使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看分析在Linux系统下开发的项目代码,我们知道Linux系统中文本文件默认编码格式是UTF-8,而Windows中文系统中的默 ...

  9. Java用native2ascii命令做unicode编码转换

    背景:在做Java开发的时候,常常会出现一些乱码,或者无法正确识别或读取的文件,比如常见的validator验证用的消息资源(properties)文件就需要进行Unicode重新编码.原因是java ...

随机推荐

  1. SpringAOP入门

    Spring的AOP aop概述 Aspect Oriented Programing 面向切面(方面)编程, aop:扩展功能不修改源代码实现 aop采取横向抽取机制,取代了传统纵向继承体系重复性代 ...

  2. 跑马灯效果、jquery封装、$.fn和$.extend方法使用

    代码 index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...

  3. 1054 The Dominant Color (20分)(水)

    Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of i ...

  4. 1034 Head of a Gang (30分)(dfs 利用map)

    One way that the police finds the head of a gang is to check people's phone calls. If there is a pho ...

  5. fastfdfs搭配nginx

    fastfdfs搭配nginx 下载fastdfs-nginx-module 模块 wget https://github.com/happyfish100/fastdfs-nginx-module/ ...

  6. 关于redis单线程的分析

    redis为什么那么快?结论有三点,大家都知道,这里主要是分析. 首先第一点 redis是内存访问的,所以快 当然这个大家都知道,所以不是重点 io密集型和cpu密集型 一般我们把任务分为io密集型和 ...

  7. web.page.regexp用法(全网唯一)

    前言 因为这个东西“web.page.regexp”,差点把自己杀了.一点都不夸张,这将近30度的天气,办公室不开空调,又要闷,还要带着口罩,躁动的很.加上这个鬼东西“web.page.regexp” ...

  8. 【python实现卷积神经网络】全连接层实现

    代码来源:https://github.com/eriklindernoren/ML-From-Scratch 卷积神经网络中卷积层Conv2D(带stride.padding)的具体实现:https ...

  9. Ansible简明教程

    Ansible是当下比较流行的自动化运维工具,可通过SSH协议对远程服务器进行集中化的配置管理.应用部署等,常结合Jenkins来实现自动化部署. 除了Ansible,还有像SaltStack.Fab ...

  10. C - League of Leesins

    乱搞一发,,竟然过了!!! 题目大意:输入一个整数n,然后n-2行,每一行3个数字,表示一个数组中连续的3个数字,然后将这3个数字的顺序打乱,然后再将这个n-2行打乱,要求还原数组. 题解:先找到前3 ...