Mac OS 使用iconv 将gb18030编码文本转换为utf-8格式文本
来源:互联网 发布:ubuntu怎样打开终端 编辑:程序博客网 时间:2024/04/30 04:19
- Mac OS X comes with iconv utility that can convert text between encodings. Run the following command in Terminal to convert a gb2312 chinese text file to utf-8:
iconv -f cp936 -t utf-8 chinese-gb2312.txt > chinese-utf8.txt
- To list the encodings that iconv supports:
iconv -l
以下是自己写的使用shell递归转换一个文件目录下的文件格式到utf-8格式的脚本
#!/bin/bash function encode() {iconv -f cp936 -t utf-8 "$1" > test# iconv -f iso8859-15 -t utf8 "$1" > test;cat test > "$1";}function walk() { for file in `ls $1` do local path=$1"/"$file if [ -d $path ] then echo "DIR $path" walk $path else echo "FILE $path" encode $path fi done } if [ $# -ne 1 ] then echo "USAGE: $0 TOP_DIR" else walk $1 fi
- Mac OS 使用iconv 将gb18030编码文本转换为utf-8格式文本
- 将eclipse文本编码格式修改为UTF-8
- 使用文本编辑器将字符转换成UTF-8编码
- iconv转换编码格式 gbk utf-8
- 使用iconv批量转换文件编码为utf-8
- 如何将右键新建文本文档默认编码设为UTF-8格式
- Eclipse文本编码格式修改为UTF-8 的方法
- 默认新建文本文档编码为UTF-8格式
- VS中 修改文本编码格式 为"UTF-8"
- Eclipse文本编码格式修改为UTF-8
- eclipse文本编码格式修改为UTF-8
- 指定输出文本为utf-8编码格式
- linux 批量转换文本编码为UTF-8
- 用iconv实现的gb18030到utf-8的编码转换
- 用iconv实现的gb18030到utf-8的编码转换
- 用iconv实现的gb18030到utf-8的编码转换
- 将windows下的ansi格式文本转换为linux下能识别的UTF-8格式
- Linux使用iconv将gbk编码转化为utf-8编码
- 文件操作
- 1012. The Best Rank (25)
- source insight快捷键及使用技巧
- ARM在linux pc下的挂载
- 说说RSA加密解密的知识
- Mac OS 使用iconv 将gb18030编码文本转换为utf-8格式文本
- JAVA socket编程实例
- webservice 第三方接口
- linux C 遍历目录及其子目录
- 基本语言细节--浅析const用法---基于VC++2012环境验证
- 基于稀疏表示的人脸识别
- Thinkpad S1 Yoga 没有兴奋点的设计
- Git深入体验之旅六:Git工具
- 在Mysql中存入图片