📄 iconv.1
字号:
.\" Copyright (C) BULL, Digital Equipment Co., SIEMENS 1986,1987,1988.\" SCCSID: @(#)iconv.1 19.1 89/01/19.TH iconv 1.SH Name iconv \- international codeset conversion.SH Syntax.B iconv[\fB\-d\fR] \fB-f\fR \fIfromcodeset\fR \fB-t\fR \fItocodeset\fR [\fIfile...\fR].br.SH DescriptionThe.PN iconvcommand converts the encoding of characters in its inputfrom one codeset to another codeset. The \fIfromcodeset\fPargument specifies the codeset used to encode the data in the input;that is, it specifies the input codeset. The \fItocodeset\fPargument specifies the codeset to which you want the input data converted; that is, it specifies the output codeset.The .PN iconvcommand performs the conversion by reading rules from aconversion table youcreate. The command reads its input from standard input or from one or more files named on the command line.The command writes its output to standard output..PPYou define conversion rules in aconversion table. The conversion rules specify how .PN iconvconverts a particular character or group of characters, which are called tokens. The conversion table is a text file that contains two lists.In the left-hand list, you specify each token you want .PN iconvto convert. In the right-hand list, you specify the token you want.PN iconvto create in the output file. For example, if you issued the following command:.EX% iconv \-fupper \-tlower conversion_file.EE.PPThis command uses the conversion table located in the file .PN /usr/lib/intln/conv/upper_lower , that specifies how to convert from an uppercase codeset to a lowercase codeset. The following shows part of the conversion table: .EX 0## Converts from uppercase to lowercase## Input token Output token# ------------- ------------------ A a B b C c D d E e F f G g . . . Z z## Convert tabs to spaces using octal# \\011 \\040\\040\\040## Convert the A umlaut to lowercase# A\(.. a\(...EE.PPEach line in the conversion table must contain two strings, an input token andan output token. The tokens must be delimited with spaces or tabs.The backslashcharacter ( \\\ ) either causes the .PN iconvcommand to recognize a character it normally ignores or introducesa three digit octal constant. All octal constants in the conversiontable must contain three digits. Lines that begin with a hash symbol (#) are comments.The .PN iconv command ignores comment lines and blank lines. .PPYou name the conversion table file using the name of the inputcodeset, an underscore, and the name of the output codeset.For example, if your input codeset is ISO646 and your output codeset is ISO8859, you might name the conversion table file.PN 646_8859 ..PPThe .PN iconvcommand searches for the conversion table file in the directory specified bythe .PN ${ICONV}/convpathname.If the ${ICONV} environment variable is undefined,the .PN iconvcommand searches the .PN /usr/lib/intln/convdirectory. .PPThe operation of the .PN iconvcommand is 8-bit transparent..SH Options.IP \fB\-d\fR 0.3iDeletes any characters that are omitted from the conversion table.By default, the.PN iconvcommand sends characters that are omitted to the output file without modifying them..IP \fB\-f\fR 0.3iSpecifies the name of the input codeset..IP \fB\-t\fR 0.3iSpecifies the name of the output codeset..SH Restrictions The conversion table file name can contain no more than 255 characters.You may need to truncate the name of the input codeset or output codeset when you name the conversion table file..SH Examples The following shows an example of using the .PN iconvcommand:.EX 0.UI "% " "iconv \-f646 \-t8859 mydatafile > newdatafile".EE.PPThis command converts the data in.PN mydatafilefrom ISO646 encoding to ISO8859encoding. The .PN iconv command reads the conversion table from the .PN ${ICONV}/conv/646_8859file. If the ${ICONV} environment variable is undefined, the.PN iconvcommand uses the.PN /usr/lib/intln/conv/646_8859 file. If that file does not exist, the .PN iconvcommand issues an error message and does not convert the data file.The .PN iconvcommand writes the results of any conversion it performs to the file.PN newdatafile.SH Files.PN /usr/lib/conv/\fIfromcodeset_tocodeset\fP.br.PN ${ICONV}/conv/\fIfromcodeset_tocodeset\fP.SH See Alsoenviron(5int) .br\fIGuide to Developing International Software\fP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -