一些和中文转化有关的东西

系统字体配置、中文显示和输入法问题
回复
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

一些和中文转化有关的东西

#1

帖子 oneleaf » 2006-03-10 9:53

转化中文文件名:
apt-get install convmv
将 当前目录下的所有 的文件名 由 gb2312 编码转化到 utf-8 的文件名
convmv -r -f cp936 -t utf8 --notest --nosmart *


批量转化文件内容:
将当前目录下的所有文件的内容由 gbk 编码转化到 utf-8 编码

代码: 全选

#!/bin/sh
for i in *
do
iconv -f gbk -t utf8 $i >tmp
cp tmp $i
rm tmp
done
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#2

帖子 eexpress » 2006-03-14 2:07

--nosmart
by default convmv will detect if a filename is already UTF8 encoded
and will skip this file if conversion from some charset to UTF8
should be performed. "--nosmart" will also force conversion to
UTF-8 for such files, which might result in "double encoded UTF-8"
(see section below).
● 鸣学
lzwxiaotian
帖子: 31
注册时间: 2007-04-17 20:28

#3

帖子 lzwxiaotian » 2007-04-27 22:51

sunny@sunny:~$ sudo apt-get install convmv
E: 无法获得锁 /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
sunny@sunny:~$


buxing ha
回复