1 .\" Id: preconv.1,v 1.7 2013/07/13 19:41:16 schwarze Exp
3 .\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 .Nd recode multibyte UNIX manuals
31 utility recodes multibyte
36 or other troff system supporting the
42 By default, it parses from standard output, determining encoding as
46 Its arguments are as follows:
51 The document's encoding.
56 The recoded input is written to standard output: Unicode characters in
57 the ASCII range are printed as regular ASCII characters, while those
58 above this range are printed using the
63 If input bytes are improperly formed in the current encoding, they're
64 passed unmodified to standard output.
65 For some encodings, such as UTF-8, unrecoverable input sequences will
68 to stop processing and exit.
70 An encoding is chosen according to the following steps:
73 From the argument passed to
76 If a BOM exists, UTF\-8 encoding is selected.
78 From the coding tags parsed from
80 on the first two lines of input.
81 A file variable is an input line of the form
83 .Dl \%.\e\(dq -*- key: val [; key: val ]* -*-
85 A coding tag variable is where
91 is the name of the encoding.
92 A typical file variable with a coding tag is
94 .Dl \%.\e\(dq -*- mode: troff; coding: utf-8 -*-
96 From the argument passed to
99 If all else fails, Latin\-1 is used.
104 utility recognises the UTF\-8, us\-ascii, and latin\-1 encodings as
109 arguments, or as coding tags.
110 Encodings are matched case-insensitively.
111 .\" .Sh IMPLEMENTATION NOTES
112 .\" Not used in OpenBSD.
113 .\" .Sh RETURN VALUES
114 .\" For sections 2, 3, & 9 only.
116 .\" For sections 1, 6, 7, & 8 only.
121 Explicitly page a UTF\-8 manual
123 in the current locale:
125 .Dl $ preconv \-e utf\-8 foo.1 | mandoc -Tlocale | less
127 .\" For sections 1, 4, 6, 7, & 8 only.
129 .\" For sections 2, 3, & 9 only.
136 utility references the US-ASCII character set standard, ANSI_X3.4\-1968;
137 the Latin\-1 character set standard, ISO/IEC 8859\-1:1998; the UTF\-8
138 character set standard; and UCS (Unicode), ISO/IEC 10646.
142 utility first appeared in the GNU troff
144 system in December 2005, authored by Tomohiro Kubota and Werner
146 The implementation that is part of the
148 utility appeared in May 2011.
152 utility was written by
153 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
156 .\" .Sh SECURITY CONSIDERATIONS
157 .\" Not used in OpenBSD.