]>
Commit | Line | Data |
---|---|---|
111cf06c MM |
1 | '\" t -*- coding: UTF-8 -*- |
2 | .\" | |
3 | .\" Copyright (C) 2014 Marko Myllynen <myllynen@redhat.com> | |
4 | .\" | |
5 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) | |
6 | .\" This is free documentation; you can redistribute it and/or | |
7 | .\" modify it under the terms of the GNU General Public License as | |
8 | .\" published by the Free Software Foundation; either version 2 of | |
9 | .\" the License, or (at your option) any later version. | |
10 | .\" | |
11 | .\" The GNU General Public License's references to "object code" | |
12 | .\" and "executables" are to be interpreted as the output of any | |
13 | .\" document formatting or typesetting system, including | |
14 | .\" intermediate and printed output. | |
15 | .\" | |
16 | .\" This manual is distributed in the hope that it will be useful, | |
17 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | .\" GNU General Public License for more details. | |
20 | .\" | |
21 | .\" You should have received a copy of the GNU General Public | |
22 | .\" License along with this manual; if not, see | |
23 | .\" <http://www.gnu.org/licenses/>. | |
24 | .\" %%%LICENSE_END | |
25 | .\" | |
26 | .TH ICONV 1 2014-06-06 "GNU" "Linux User Manual" | |
27 | .SH NAME | |
28 | iconv \- convert text from one character encoding to another | |
29 | .SH SYNOPSIS | |
30 | .B iconv | |
31 | .RI [ options ] | |
32 | .RI "[-f " from-encoding "]" | |
33 | .RI "[-t " to-encoding "]" | |
34 | .RI [ inputfile ]... | |
35 | .SH DESCRIPTION | |
36 | The | |
37 | .B iconv | |
38 | program reads in text in one encoding and outputs the text in another | |
39 | encoding. | |
40 | If no input files are given, or if it is given as a dash (\-), | |
41 | .B iconv | |
42 | reads from the standard input. | |
43 | If no output file is given, | |
44 | .B iconv | |
45 | writes to the standard output. | |
46 | .PP | |
47 | If no | |
48 | .I from-encoding | |
49 | is given, the default is derived | |
50 | from the current locale's character encoding. | |
51 | If no | |
52 | .I to-encoding | |
53 | is given, the default is derived | |
54 | from the current locale's character | |
55 | encoding. | |
56 | .SH OPTIONS | |
57 | .TP | |
58 | .BI \-f " from-encoding" ", \-\-from-code=" from-encoding | |
59 | Use | |
60 | .I from-encoding | |
61 | for input characters. | |
62 | .TP | |
63 | .BI \-t " to-encoding" ", \-\-to-code=" to-encoding | |
64 | Use | |
65 | .I to-encoding | |
66 | for output characters. | |
67 | ||
68 | If | |
69 | .I to-encoding | |
70 | is appended with | |
71 | .BR //IGNORE , | |
72 | characters that cannot be converted are discarded and an error is | |
73 | printed after conversion. | |
74 | ||
75 | If | |
76 | .I to-encoding | |
77 | is appended with | |
78 | .BR //TRANSLIT , | |
79 | characters being converted are transliterated when needed and possible. | |
80 | This means that when a character cannot be represented in the target | |
81 | character set, it can be approximated through one or several similarly | |
82 | looking characters. | |
83 | Characters that are outside of the target character set and cannot be | |
84 | transliterated are replaced with a question mark (?) in the output. | |
85 | .TP | |
86 | .B "\-l, \-\-list" | |
87 | List all known character set encodings. | |
88 | .TP | |
89 | .B "\-c" | |
90 | Silently discard characters that cannot be converted instead of | |
91 | terminating when encountering such a character. | |
92 | .TP | |
93 | .BI \-o " outputfile" ", \-\-output=" outputfile | |
94 | Use | |
95 | .I outputfile | |
96 | for output. | |
97 | .TP | |
98 | .B "\-s, \-\-silent" | |
99 | This option is ignored, it is provided only for compatibility. | |
100 | .TP | |
101 | .B "\-\-verbose" | |
102 | Print progress information on standard error when processing | |
103 | multiple files. | |
104 | .TP | |
105 | .B "\-\-help" | |
106 | Print a usage summary and exit. | |
107 | .TP | |
108 | .B "\-\-usage" | |
109 | Print a short usage summary and exit. | |
110 | .TP | |
111 | .B "\-V, \-\-version" | |
112 | Print the version number, license, and disclaimer of warranty for | |
113 | .BR iconv . | |
114 | .SH EXIT STATUS | |
115 | Zero on success, non-zero on errors. | |
116 | .SH ENVIRONMENT | |
117 | Internally, the | |
118 | .B iconv | |
119 | program uses the | |
120 | .BR iconv (3) | |
121 | function which in turn uses | |
122 | .I gconv | |
123 | modules to convert to and from a character set. | |
124 | .B iconv | |
125 | supports any character set for which a | |
126 | corresponding gconv configuration and module are provided for. | |
127 | By default, the system provided gconv configuration and modules | |
128 | are used, but | |
129 | .B GCONV_PATH | |
130 | can be defined as a list of pathnames, separated by colons (\(aq:\(aq), | |
131 | for gconv configuration and module search path, | |
132 | to be searched prior to the system provided configuration and modules. | |
133 | If | |
134 | .B GCONV_PATH | |
135 | is set, the system gconv module configuration cache (created by | |
136 | .BR iconvconfig (8)) | |
137 | will not be used. | |
138 | Only directories containing the | |
139 | .I gconv-modules | |
140 | configuration files will be searched for the specified gconv modules. | |
141 | .SH FILES | |
142 | .TP | |
143 | .I /usr/lib/gconv | |
144 | Usual default gconv module path. | |
145 | .TP | |
146 | .I /usr/lib/gconv/gconv-modules | |
147 | Usual default gconv module configuration. | |
148 | .TP | |
149 | .I /usr/lib/gconv/gconv-modules.cache | |
150 | Usual default gconv module configuration cache. | |
151 | .SH CONFORMING TO | |
152 | POSIX.1-2001. | |
153 | .SH EXAMPLE | |
154 | Convert text from the ISO 8859-15 character encoding to UTF-8 | |
155 | encoding: | |
156 | .PP | |
157 | .RS | |
158 | iconv \-f ISO\-8859\-15 -t UTF\-8 < input.txt > output.txt | |
159 | .RE | |
160 | .PP | |
161 | The next example converts from UTF-8 to ASCII, transliterating when | |
162 | possible: | |
163 | ||
164 | .nf | |
165 | $ \fBecho abc ß α € àḃç | iconv -f UTF-8 -t ASCII//TRANSLIT\fP | |
166 | abc ss ? EUR abc | |
167 | $ | |
168 | .fi | |
169 | .SH "SEE ALSO" | |
170 | .BR locale (1), | |
171 | .BR iconv (3), | |
172 | .BR nl_langinfo (3), | |
173 | .BR charsets (7), | |
174 | .BR iconvconfig (8) |