有什么好方法可以把档案及资料夹名称从Unicode的简体转成繁体,或著是繁体转简体
有无类似convertZ好用的工具?
请教如何转换档案编码
-
- 帖子: 6
- 注册时间: 2006-06-03 18:14
- iblicf
- 帖子: 3766
- 注册时间: 2007-01-15 17:15
代码: 全选
ICONV(1) Linux Programmer's Manual ICONV(1)
NAME
iconv - 字符集转换
B>8> (SYNOPSIS)
iconv [-f encoding] [-t encoding] [inputfile ...]
F>0> (DESCRIPTION)
iconv 程序 把 文本 从 一种 编码 转换 为 另一种 编码. 更准确一点, 他是
把 -f 指定的 编码 转换为 -t 指定的 编码. 这两种 编码 默认 都是 当前
locale 的编码, 所有 inputfile 都依次 进行转换. 如果没有指定 inputfile
则使用 标准输入. 转换后的 内容 会 输出到 标准输出.
允许的 编码 与 具体系统 有关. 具体 实现 可以 查看 iconv_open(3) 手册页.
2>1> (SEE ALSO)
iconv_open(3), locale(7)
TRANSBY
LinuxForum.Net CMPP 中文手册页计划 http://cmpp.linuxforum.net
* Thu Mar 21 2002 唐友 <[email protected]>
- 初始版本
GNU February 20, 2001 ICONV(1)
-
- 帖子: 232
- 注册时间: 2006-11-11 18:37
-
- 帖子: 6
- 注册时间: 2006-06-03 18:14
有无演示范例?
我找了几个网站,像是http://wwwstud.uni-leipzig.de/~mai03kbz/wiki/pmwiki/pmwiki.php?n=Main.Linux的范例
不过还是无法使用
我找了几个网站,像是http://wwwstud.uni-leipzig.de/~mai03kbz/wiki/pmwiki/pmwiki.php?n=Main.Linux的范例
代码: 全选
4.2、转换目录/文件名中的乱码需要使用 convmv,如果还没有安装 convmv, 需要使用 root 权限来安装:
$ sudo apt-get install convmv
然后通过终端进入乱码目录中,
输入:$sudo convmv -r -f cp936 -t utf8 –nosmart –notest /文件目录
- iblicf
- 帖子: 3766
- 注册时间: 2007-01-15 17:15
使用iconv转换
iconv是用来转换编码的小工具。现在的iconv在执行编码从gb2312到big5的转化时,实现了简繁转换。
使用iconv进行简繁转换的方法为:
iconv -f gb2312 -t big5 gb_input.txt > big5_output.txt
如果原来的文件是UTF-8编码的,则需要使用命令:
iconv -f utf8 -t gb2312 jian.txt | iconv -f gb2312 -t big5 | iconv -f big5 -t utf8 > fan.txt
注意一定要先转化成gb2312,再由gb2312转成big5。
繁简转换则类似:
iconv -f utf8 -t big5 fan.txt | iconv -f big5 -t gb2312 | iconv -f gb2312 -t utf8 > jian.txt
如果有zh-autoconvert,则可以用它代替中间的iconv,如
iconv -f utf8 -t big5 fan.txt | autogb | iconv -f gbk -t utf8 > jian.txt
或
iconv -f utf8 -t gbk jian.txt | autob5 | iconv -f big5 -t utf8 > fan.txt
-
- 帖子: 6
- 注册时间: 2006-06-03 18:14
感谢过您的回覆
不过我是要转资料夹里的档名,而非转换档案内容的编码
稍早前我看到这篇文
viewtopic.php?t=106434
於是我学著作(简体转繁体):
还是不行 
不过我是要转资料夹里的档名,而非转换档案内容的编码
稍早前我看到这篇文
viewtopic.php?t=106434
於是我学著作(简体转繁体):
代码: 全选
convmv -f utf8 -t big5 --nosmart 1/*
Starting a dry run without changes...
big5-eten doesn't cover all needed characters for: "1/陈绮贞 华丽的冒险"
To prevent damage to your files, we won't continue.
First fix errors or correct options!

- millenniumdark
- 论坛版主
- 帖子: 4159
- 注册时间: 2005-07-02 14:41
- 系统: Ubuntu 14.04 (Kylin)
- 联系:
這種方法,一般情況是可以的。但是如果有生僻字,就在轉換過程中丟失的。iblicf 写了:使用iconv转换
iconv是用来转换编码的小工具。现在的iconv在执行编码从gb2312到big5的转化时,实现了简繁转换。
使用iconv进行简繁转换的方法为:
iconv -f gb2312 -t big5 gb_input.txt > big5_output.txt
如果原来的文件是UTF-8编码的,则需要使用命令:
iconv -f utf8 -t gb2312 jian.txt | iconv -f gb2312 -t big5 | iconv -f big5 -t utf8 > fan.txt
注意一定要先转化成gb2312,再由gb2312转成big5。
繁简转换则类似:
iconv -f utf8 -t big5 fan.txt | iconv -f big5 -t gb2312 | iconv -f gb2312 -t utf8 > jian.txt
如果有zh-autoconvert,则可以用它代替中间的iconv,如
iconv -f utf8 -t big5 fan.txt | autogb | iconv -f gbk -t utf8 > jian.txt
或
iconv -f utf8 -t gbk jian.txt | autob5 | iconv -f big5 -t utf8 > fan.txt