iconv命令可以将一种已知的字符集文件转换成另一种已知的字符集文件。
iconv -f eucJP -t sjis 输入文件 > 输出文件
输入/输出格式规范:
-f, –from-code=NAME 原始文本编码
-t, –to-code=NAME 输出编码
以下说明来源于 HP-UX B.11.31 U ia64
NAME
iconv – codeset conversion
SYNOPSIS
iconv [-cs] -f frommap -t tomap [file]…
iconv [-cs] -f fromcode [-t tocode] [file]…
iconv [-cs] -t tocode [-f fromcode] [file]…
iconv -l
DESCRIPTION
The iconv command converts the encoding of characters in the input
files from one codeset to another, and writes the results to standard
output. If no input files are given, iconv reads from standard input.
If – appears as an input file name, the iconv command reads standard
input at that point. — can be used to delimit the end of options
(see getopt(3C)).
Options
The iconv command recognizes the following options:
-c Omit any characters that are invalid in the
codeset of the input file from the output. This