linux访问工具图标,linux上的编码转换工具iconv,enca,convmv

本文介绍了三个用于文本文件内码和文件名编码转换的实用工具:iconv、enca和convmv。iconv用于文本文件的编码转换,支持多种编码格式,并提供了详细的使用选项。enca不仅能够检测文本文件的编码,还可以进行转换,同时提供了不同的输出选项。convmv专注于文件名编码的转换,支持递归操作和多种编码间的转换。这些工具对于处理不同编码的文件和文件名非常有用。
摘要由CSDN通过智能技术生成

1、iconv - 文本文件内码转换

$ iconv --help

用法: iconv [选项...] [文件...]

转换给定文件的编码。

输入/输出格式规范:

-f, --from-code=名称     原始文本编码

-t, --to-code=名称       输出编码

信息:

-l, --list                 列举所有已知的字符集

输出控制:

-c                         从输出中忽略无效的字符

-o, --output=FILE          输出文件

-s, --silent               关闭警告

--verbose              打印进度信息

-?, --help                 给出该系统求助列表

--usage                给出简要的用法信息

-V, --version              打印程序版本号

2、enca - 文本文件内码转换

$ enca --help

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 converters)

-f, --human-readable    Print full (descriptive) 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-converter-program=PATH

Set external converter program name

(default: piconv)

-C, --try-converters=LIST  Converters 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, converters,

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.

3、convmv - 文件名编码转换

$ convmv --help

convmv 1.12 - converts filenames from one encoding to another

Copyright (C) 2003-2008 Bjoern JACKE This program comes with ABSOLUTELY NO WARRANTY; it may be copied or modified

under the terms of the GNU General Public License version 2 or 3 as published

by the Free Software Foundation.

USAGE: convmv [options] FILE(S)

-f enc     encoding *from* which should be converted

-t enc     encoding *to* which should be converted

-r         recursively go through directories

-i         interactive mode (ask for each action)

--nfc      target files will be normalization form C for UTF-8 (Linux etc.)

--nfd      target files will be normalization form D for UTF-8 (OS X etc.)

--qfrom    be quiet about the "from" of a rename (if it screws up your terminal e.g.)

--qto      be quiet about the "to" of a rename (if it screws up your terminal e.g.)

--exec c   execute command instead of rename (use #1 and #2 and see man page)

--list     list all available encodings

--lowmem   keep memory footprint low (see man page)

--nosmart  ignore if files already seem to be UTF-8 and convert if posible

--notest   actually do rename the files

--replace  will replace files if they are equal

--unescape convert%20ugly%20escape%20sequences

--upper    turn to upper case

--lower    turn to lower case

--parsable write a parsable todo list (see man page)

--help     print this help

阅读(2814) | 评论(0) | 转发(0) |

0

下一篇:没有了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值