xref: /freebsd/usr.bin/iconv/iconv.1 (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1.\" $NetBSD: iconv.1,v 1.3 2008/03/20 11:35:44 tnozaki Exp $
2.\"
3.\" Copyright (c)2003 Citrus Project,
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.Dd October 22, 2009
28.Dt ICONV 1
29.Os
30.Sh NAME
31.Nm iconv
32.Nd codeset conversion utility
33.Sh SYNOPSIS
34.Nm
35.Op Fl cs
36.Fl f
37.Ar from_name
38.Fl t
39.Ar to_name
40.Op Ar file ...
41.Nm
42.Fl f
43.Ar from_name
44.Op Fl cs
45.Op Fl t Ar to_name
46.Op Ar file ...
47.Nm
48.Fl t
49.Ar to_name
50.Op Fl cs
51.Op Fl f Ar from_name
52.Op Ar file ...
53.Nm
54.Fl l
55.Sh DESCRIPTION
56The
57.Nm
58utility converts the codeset of
59.Ar file
60(or from standard input if no file is specified) from codeset
61.Ar from_name
62to codeset
63.Ar to_name
64and outputs the
65converted text on standard output.
66.Pp
67The following options are available:
68.Bl -tag -width 0123
69.It Fl c
70Prevent output of any invalid characters.
71By default,
72.Nm
73outputs an
74.Dq invalid character
75specified by the
76.Ar to_name
77codeset when it encounts a character which is valid in the
78.Ar from_name
79codeset but does not have a corresponding character in the
80.Ar to_name
81codeset.
82.It Fl f
83Specifies the source codeset name as
84.Ar from_name .
85.It Fl l
86Lists available codeset names.
87Note that not all combinations of
88.Ar from_name
89and
90.Ar to_name
91are valid.
92.It Fl s
93Silent.
94By default,
95.Nm
96outputs the number of
97.Dq invalid characters
98to standard error if they exist.
99This option prevents this behaviour.
100.It Fl t
101Specifies the destination codeset name as
102.Ar to_name .
103.El
104.Sh EXIT STATUS
105.Ex -std iconv
106.Sh EXAMPLES
107Convert
108.Pa file.txt
109from IBM273 to UTF-8 and save the result to
110.Pa converted.txt :
111.Pp
112.Dl iconv -f IBM273 -t UTF-8 file.txt > converted.txt
113.Sh SEE ALSO
114.Xr mkcsmapper 1 ,
115.Xr mkesdb 1 ,
116.Xr iconv 3
117.Sh STANDARDS
118.Nm
119conform to
120.St -p1003.1-2008 .
121.Sh HISTORY
122.Nm
123first appeared in
124.Nx 2.0 , and made its appearance in
125.Fx 9.0 .
126