File: mbconv.man

package info (click to toggle)
libmoe 1.5.2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,772 kB
  • ctags: 267,598
  • sloc: ansic: 478,484; perl: 2,308; makefile: 199; sh: 22
file content (333 lines) | stat: -rw-r--r-- 10,610 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R

.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "MBCONV 1"
.TH MBCONV 1 "2001-03-12" "perl v5.6.1" " "
.UC
.SH "NAME"
\&\fBmbconv\fR \- Character encoding scheme converter
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\&  mbconv [options] <file> ...
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This is an application of
a library
to handle multiple octets character encoding:
.PP
.Vb 1
\&  http://pub.ks-and-ks.ne.jp/prog/libmoe/
.Ve
mainly written for debugging of the library.
.PP
It reads octet by octet from files given on command line
(or standard input if no file is specified),
converts character encoding scheme (\s-1CES\s0) as specified by command line options
(described below),
and output to standard output
(or a file specified by \fB\-t\fR option or \fB\-a\fR option).
.Sh "Options"
.IX Subsection "Options"
.IP "\fB\-?\fR, \fB\-h\fR, \fB\-\-help\fR" 4
.IX Item "-?, -h, --help"
display summary of options and exits.
.IP "\fB\-a\fR \fIfile\fR, \fB\-\-append\-to\fR=\fIfile\fR" 4
.IX Item "-a file, --append-to=file"
output is appended to \fIfile\fR.
.IP "\fB\-c\fR \fIconverters\fR, \fB\-\-convert\-to\fR=\fIconverters\fR" 4
.IX Item "-c converters, --convert-to=converters"
specifies character encoding conversion.
\&\fIconverters\fR must be comma separated list of
words described in \*(L"Conversion specifiers\*(R".
.IP "\fB\-f\fR \fIflags\fR, \fB\-\-flag\fR=\fIflags\fR" 4
.IX Item "-f flags, --flag=flags"
specifies flags to change behavior of conversion.
\&\fIflags\fR must be comma separated list of
words describe in \*(L"Flag specifiers\*(R".
.IP "\fB\-i\fR, \fB\-\-input\fR" 4
.IX Item "-i, --input"
succeeding options apply to input stream.
.IP "\fB\-m\fR \fIstring\fR, \fB\-\-mime\-charset\fR=\fIstring\fR" 4
.IX Item "-m string, --mime-charset=string"
mime encoding conforming to \s-1RFC2047\s0 is performed.
<string> is used as charset name.
.IP "\fB\-n\fR, \fB\-\-line\-number\fR" 4
.IX Item "-n, --line-number"
line number (>= 1) is inserted to beginning of each line.
.IP "\fB\-o\fR, \fB\-\-output\fR" 4
.IX Item "-o, --output"
succeeding options apply to output stream.
.IP "\fB\-t\fR \fIfile\fR, \fB\-\-to\fR=\fIfile\fR" 4
.IX Item "-t file, --to=file"
output to file (truncated).
.IP "\fB\-w\fR, \fB\-\-width\fR" 4
.IX Item "-w, --width"
output width of each line.
.IP "\fB\-cs\fR <string>, \fB\-\-charset\fR=\fIstring\fR" 4
.IX Item "-cs <string>, --charset=string"
specifies charset name.
Some language specifications are also accepted as well as \s-1MIME\s0 charset names,
which are used to restrict candidates of encoding scheme of input stream.
Acceptable languages are listed in \*(L"Acceptable languages\*(R".
.IP "\fB\-\-format\fR=\fIstring\fR" 4
.IX Item "--format=string"
specifies output format
.IP "\fB\-\-which\fR" 4
.IX Item "--which"
output charset name of each input stream to stderr,
in the form
.Sp
\&\fIfile name\fR\f(CW\*(C`:\*(C'\fR \fIcharset name\fR
.Sp
if two or more files are specifed on the command line, or
.Sp
\&\fIcharset name\fR
.Sp
otherwise.
.IP "\fB\-\-regex\fR=\fIregular expression\fR" 4
.IX Item "--regex=regular expression"
specifies regeular expression to filter output.
Character encoding of \fIregular expression\fR can be specified
by putting string of the form
.Sp
\&\f(CW\*(C`*\*(C'\fR\fIcharset name\fR\f(CW\*(C`*\*(C'\fR
.Sp
at the beginning of the regular expression,
otherwise \fB\s-1UTF\-8\s0\fR.
Character encoding of the expression
is converted to that of output stream
before matching.
.Sh "Conversion specifiers"
.IX Subsection "Conversion specifiers"
Conversion is applied
just before each character is output to stream.
Conversion setup is automatically performed
based on \s-1CES\s0.
So in most cases,
yo need not to specify converters explicitly.
.IP "\fBascii\fR" 4
.IX Item "ascii"
domestic \s-1ASCII\s0 converted to \s-1US\-ASCII\s0,
.IP "\fBces\fR" 4
.IX Item "ces"
converted appropriately according to
the \s-1CES\s0 bound to input/output stream,
.IP "\fBto-ucs\fR" 4
.IX Item "to-ucs"
converted to Unicode,
.IP "\fBf2h\fR, \fBfull-to-half\fR" 4
.IX Item "f2h, full-to-half"
Fullwidth compatibility characters are converted to
corresponding halfwidth ones,
.IP "\fBh2f\fR, \fBhalf-to-full\fR" 4
.IX Item "h2f, half-to-full"
Halfwidth compatibility characters are converted to
corresponding fullwidth ones,
.IP "\fBjisx0213\fR" 4
.IX Item "jisx0213"
Codepoints in \s-1JIS\s0 C 6226 or in \s-1JIS\s0 X 0208 which are bound to no
character are converted into \s-1JIS\s0 X 0213 plane 1,
.IP "\fBjisx0213\-aggressive\fR" 4
.IX Item "jisx0213-aggressive"
All codepoints in \s-1JIS\s0 C 6226 or in \s-1JIS\s0 X 0208 are converted into \s-1JIS\s0 X
0213 plane 1,
.IP "\fBms\-latin1\fR" 4
.IX Item "ms-latin1"
Unicode characters of code point between 0x80 and
0x9F (both inclusive) are converted to other
Unicode characters as if they are characters of those
code point in Microsoft Windows Codepage 1252.
.IP "\fBucs\-to\-jis0208\-extra\fR, \fBjis0208\-to\-ucs\-extra\fR" 4
.IX Item "ucs-to-jis0208-extra, jis0208-to-ucs-extra"
Converters between some \s-1JIS\s0 X 0208 and Unicode characters having similar glyphs
(by the courtesy of Ambrose Li <acli@ada.dhs.org>).
.Sh "Flag specifiers"
.IX Subsection "Flag specifiers"
.IP "\fBuse\-0x28\-for\-94x94inG0\fR, \fB28\fR" 4
.IX Item "use-0x28-for-94x94inG0, 28"
use \*(L"1/11 2/4 2/8 F\*(R"
instead of \*(L"1/11 2/4 F\*(R"
to designate charsets with final octet
4/0, 4/1, or 4/2 to G0,
.IP "\fBac\fR, \fBascii-at-control\fR" 4
.IX Item "ac, ascii-at-control"
escape sequence \*(L"1/11 2/8 4/2\*(R" is
output before every control character,
.IP "\fBnossl\fR, \fBignore\-7bit\-single\-shift\fR" 4
.IX Item "nossl, ignore-7bit-single-shift"
escape sequence for 7 bit single shift
is ignored,
.IP "\fBdnc\fR, \fBdiscard-notprefered-char\fR" 4
.IX Item "dnc, discard-notprefered-char"
discard characters which \s-1CES\s0 bound
to output stream can not decode.
.Sh "Acceptable languages"
.IX Subsection "Acceptable languages"
The following words may be given instead of \s-1MIME\s0 charset name for input stream.
In that case,
encoding scheme
is automatically detected
(hopefully)
among
succeeding ones.
.IP "\fBc\fR, \fBcn\fR, \fBchina\fR, \fBchinese\fR" 4
.IX Item "c, cn, china, chinese"
x\-gb\-18030\-2000, cn\-big5, utf\-8, or x\-euc\-tw.
.IP "\fBj\fR, \fBja\fR, \fBjp\fR, \fBjapan\fR, \fBjapanese\fR" 4
.IX Item "j, ja, jp, japan, japanese"
euc\-jp, shift_jis, or utf\-8.
.IP "\fBk\fR, \fBko\fR, \fBkr\fR, \fBkorea\fR, \fBkorean\fR" 4
.IX Item "k, ko, kr, korea, korean"
euc\-kr, x\-johab, utf\-8, or x\-unified\-hangul.
.IP "\fBcjk\fR" 4
.IX Item "cjk"
iso\-8859\-1,
x\-gb\-18030\-2000,
cn\-big5,
x\-euc\-tw,
euc\-jp,
shift_jis,
euc\-kr,
x\-johab,
x\-unified\-hangul,
or utf\-8.
.SH "AUTHOR"
.IX Header "AUTHOR"
Kiyokazu \s-1SUTO\s0 <suto@ks\-and\-ks.ne.jp>
.SH "DISCLAIMER etc."
.IX Header "DISCLAIMER etc."
This program is distributed with
absolutely no warranty.
.PP
Anyone can use, modify, and re-distibute this program
without any restriction.