LUPA首页 | 资讯 | 教程 | 下载 | 求职 | 方案 | 博客 | 交易 | 英文版
LUPA论坛


 
标题: 文件编码查看工具
黄富强
版主
Rank: 7Rank: 7Rank: 7
开源志愿者


风雨同舟奖   宣传大使奖  
UID 18733
精华 2
积分 3185
帖子 707
LUPA币 2827 点
阅读权限 100
注册 2006-4-8
来自 哈尔滨
发表于 2007-7-5 12:44  资料 主页 个人空间 短消息 
文件编码查看工具

Usage:  enca [-L LANGUAGE] [OPTION]... [FILE]...
        enconv [-L LANGUAGE] [OPTION]... [FILE]...
Detect encoding of text files and convert them if required.

Operation modes:
-g, --guess             Behave as `enca' (just detect encoding by default)
-c, --auto-convert      Behave as `enconv' (autoconvert by default)

Output type selectors:
-d, --details           Print failure reason when encoding was not recognized
-e, --enca-name         Print enca's encoding name (passed to convertors)
-f, --human-readable    Print full (descrīptive) encoding name (default)
-i, --iconv-name        Print how iconv calls the encoding
-m, --mime-name         Print preferred MIME encoding name
-r, --rfc1345-name      Print RFC 1345 (or otherwise canonized) encoding name
-s, --cstocs-name       Print how cstocs calls the encoding
-n, --name=WORD         Print required name (enca-name, human-readable, etc.)
-x, --convert-to=ENC    Convert file to some other encoding ENC

Guessing parameters:
-L, --language=LANG     Set language of FILEs; obligatory, when cannot be
                         determined from locale settings

Conversion parameters:
-E, --external-convertor-program=PATH
                         Set external convertor program name
                         (default: piconv)
-C, --try-convertors=LIST  Convertors to be tried (associative)
                         (default: built-in,librecode)

General options:
-p, --with-filename     Print the file name for each result
-P, --no-filename       Suppress the prefixing filename on output
-V, --verbose           Increase verbosity level

Listings:
-G, --license           Print full enca license and terminate
-h, --help              Print this help and terminate
-l, --list=WORD         Print required list (built-in-charsets, convertors,
                         charsets, languages, lists, names, surfaces)
                         and terminate
-v, --version           Print version and build information and terminate

With no FILE, reads standard input and possibly writes converted stream to
standard output.  Exit status is 0 if all files were successfully proceeded,
1 if some were not recognized or converted, 2 in real troubles.

When called as `enconv' without -x, target encoding it guessed from locales.

Report bugs to David Necas (Yeti) <yeti@physics.muni.cz>
(please include `Enca' in subject).

附件:



[ 本帖最后由 黄富强 于 2007-7-5 12:48 编辑 ]


图片附件: 18733_200707051244331.png (2007-7-5 12:48, 26.76 K)





顶部
[广告] 推荐个超酷的web2.0相册
walkerxk (walkerxk)
LUPA团队
Rank: 9Rank: 9Rank: 9
点一盏金蜡烛,为灾区人民祈福。


风雨同舟奖  
UID 980
精华 0
积分 14812
帖子 2374
LUPA币 13625 点
阅读权限 200
注册 2005-9-27
来自 LUPA
发表于 2007-7-5 13:21  资料 主页 个人空间 短消息  QQ ICQ 状态 Yahoo!
sudo apt-get install enca直接安装,我使用perl来转换的:perl -MEncode -pi -e '$_=encode_utf8(decode(gb2312=>$_))' a.txt
顶部
[广告] 推荐个超酷的web2.0相册
fluke
版主
Rank: 7Rank: 7Rank: 7


优秀斑竹奖  
UID 7246
精华 0
积分 3033
帖子 370
LUPA币 2848 点
阅读权限 100
注册 2005-10-16
来自 湛江
发表于 2007-7-5 13:32  资料 主页 个人空间 短消息  QQ ICQ 状态
我这里用enca要指定language -L zh_CN

转换一直都用iconv,很方便阿

iconv -f gbk -t utf8 就ok了




Fluke's Blog
I'm a user.
顶部
[广告] 推荐个超酷的web2.0相册
skyking
开源主力军
Rank: 3Rank: 3


UID 28894
精华 0
积分 913
帖子 83
LUPA币 871 点
阅读权限 30
注册 2007-1-8
发表于 2007-7-5 17:34  资料 短消息 
不错的工具嘛。。。。。。
顶部
 


当前时区 GMT+8, 现在时间是 2008-7-9 21:41
浙ICP备06002895号

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.055444 second(s), 7 queries , Gzip enabled

清除 Cookies - 联系我们 - LUPA开源社区 - Archiver - WAP