写了一个类似于 iconv 的字符转码软件,基本功能和它一样,另外支持自动探测编码格式,文件夹转换的功能。
举几个例子:
把一个文件(夹)里面的所有内容,从 big5 转到 utf-8:
./iconv-super -f big5 -t utf-8 -s math -d math-converted
加-c
,同时把非 big5 的文件 copy 到另一个文件夹:
./iconv-super -f big5 -t utf-8 -s math -d math-converted -c
加-n
,非 big5 的文件 copy 到另一个文件夹,但不转换 big5 文件:
./iconv-super -f big5 -t utf-8 -s math -d math-converted -c -n
加-c
,显示 log:
./iconv-super -f big5 -t utf-8 -s math -d math-converted -v
加-r
,正则匹配特定文件:
./iconv-super -f big5 -t utf-8 -s math -d math-converted -r .html
去掉-f
,自动探测源文件编码:
./iconv-super -t utf-8 -s math -d math-converted
用管道:
cat file |./iconv-super -f big5 -t utf-8
用管道,同时自动探测:
cat file |./iconv-super -t utf-8
项目地址:iconv-super.
如有变更,项目地址为准。
1
v1024 2017-05-20 18:18:19 +08:00 via iPhone
显然应该叫 iconv-cli
|