找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 34691|回复: 3

[文本处理] LibIconv for Windows:转换字符编码

[复制链接]
发表于 2011-1-21 22:17:49 | 显示全部楼层 |阅读模式
官网:http://gnuwin32.sourceforge.net/packages/libiconv.htm
iconv 1.9.2 下载:
http://pan.baidu.com/share/link?shareid=3925773455&uk=1124163200

LibIconv converts from one character encoding to another through Unicode conversion (see Web page for full list of supported encodings). It has also limited support for transliteration, i.e. when a character cannot be represented in the target character set, it is approximated through one or several similar looking characters. It is useful if your application needs to support multiple character encodings, but that support lacks from your system.


用这个工具转换为 UTF-8 时不会添加 BOM。

用法:
  1. iconv [-c] [-s] [-f encoding] [-t encoding] [inputfile ...]
  2. iconv -l
复制代码
例:
  1. echo 测试|iconv -t utf-8
复制代码
  1. echo 娴嬭瘯|iconv -f utf-8 -t gb18030
复制代码
  1. iconv -t utf-8 a.txt > a_utf-8.txt
复制代码
  1. iconv -t utf-8 *.txt
复制代码
iconv 1.11
http://bbs.bathome.net/thread-19842-1-1.html#pid119516

iconv 1.14
http://bbs.bathome.net/thread-21133-1-1.html
http://bcn.bathome.net/s/tool/index.html?key=iconv
 楼主| 发表于 2011-1-22 18:22:36 | 显示全部楼层
本帖最后由 tmplinshi 于 2011-4-9 06:52 编辑

发现 ConCmd.exe 也可以转换成没有 BOM,需要修改 ConCmd.ini:
AddBOMtoUTF8        当输出是 UTF-8 时指定是否加 BOM (识别码)到档案的前端,0=否,1=是
发表于 2013-1-29 16:19:13 | 显示全部楼层
实在太棒了,收了
发表于 2014-8-24 11:06:00 | 显示全部楼层
收下。。。正需要,,
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-17 05:24 , Processed in 0.018781 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表