Chinaunix首页 | 论坛 | 博客
  • 博客访问: 519828
  • 博文数量: 260
  • 博客积分: 10435
  • 博客等级: 上将
  • 技术积分: 1939
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-24 14:50
文章分类

全部博文(260)

文章存档

2011年(22)

2010年(209)

2009年(29)

我的朋友

分类: LINUX

2009-11-24 15:38:46

安装enca
apt-get install enca

查询单个文件的编码
enca index.html

转换单个文件的编码
enca -L none -x utf-8  index.html

转换批量文件的编码
find  ./ -type f -name "*.htm*" | cat $1 |  sort | grep -v svn >  files.list
vim enca_list.sh
    插入以下代码:
    #!/bin/sh
    cat $1 | while read LINE
    do
            echo $LINE
            #enca $LINE
            enca -x utf-8 $LINE
            #enca $LINE
    done
保存退出后
chmod +x enca_list.sh
执行脚本: ./enca_list.sh files.list
阅读(1320) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:[转载]smth.taobao.com

给主人留下些什么吧!~~