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