OSDN Git Service

* fix typo.
[nkf/nkf.git] / nkf.1
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  | will give a
29 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "nkf 1"
132 .TH nkf 1 "2006-07-30" "nkf 2.0.7" " "
133 .SH "NAME"
134 nkf \- Network Kanji Filter
135 .SH "SYNOPSIS"
136 .IX Header "SYNOPSIS"
137 .Vb 1
138 \&  nkf B<[-butjnesliohrTVvwWJESZxXFfmMBOcdILg]> B<[>I<file ...>B<]>
139 .Ve
140 .SH "DESCRIPTION"
141 .IX Header "DESCRIPTION"
142 \&\fBNkf\fR is a yet another kanji code converter among networks, hosts and terminals.
143 It converts input kanji code to designated kanji code
144 such as \s-1ISO\-2022\-JP\s0, Shift_JIS, \s-1EUC\-JP\s0, \s-1UTF\-8\s0 or \s-1UTF\-16\s0.
145 .PP
146 One of the most unique faculty of \fBnkf\fR is the guess of the input kanji encodings.
147 It currently recognizes \s-1ISO\-2022\-JP\s0, Shift_JIS, \s-1EUC\-JP\s0, \s-1UTF\-8\s0 and \s-1UTF\-16\s0.
148 So users needn't set the input kanji code explicitly.
149 .PP
150 By default, X0201 kana is converted into X0208 kana.
151 For X0201 kana, \s-1SO/SI\s0, \s-1SSO\s0 and \s-1ESC\-\s0(\-I methods are supported.
152 For automatic code detection, nkf assumes no X0201 kana in Shift_JIS.
153 To accept X0201 in Shift_JIS, use \fB\-X\fR, \fB\-x\fR or \fB\-S\fR.
154 .SH "OPTIONS"
155 .IX Header "OPTIONS"
156 .IP "\fB\-b \-u\fR" 4
157 .IX Item "-b -u"
158 Output is buffered (\s-1DEFAULT\s0), Output is unbuffered.
159 .IP "\fB\-j \-s \-e \-w \-w16\fR" 4
160 .IX Item "-j -s -e -w -w16"
161 Output code is \s-1ISO\-2022\-JP\s0 (7bit \s-1JIS\s0), Shift_JIS, \s-1EUC\-JP\s0,
162 \&\s-1UTF\-8N\s0, \s-1UTF\-16BE\s0.
163 Without this option and compile option, \s-1ISO\-2022\-JP\s0 is assumed.
164 .IP "\fB\-J \-S \-E \-W \-W16\fR" 4
165 .IX Item "-J -S -E -W -W16"
166 Input assumption is \s-1JIS\s0 7 bit, Shift_JIS, \s-1EUC\-JP\s0,
167 \&\s-1UTF\-8\s0, \s-1UTF\-16LE\s0.
168 .RS 4
169 .IP "\fB\-J\fR" 4
170 .IX Item "-J"
171 Assume  \s-1JIS\s0 input. It also accepts \s-1EUC\-JP\s0.
172 This is the default. This flag does not exclude Shift_JIS.
173 .IP "\fB\-S\fR" 4
174 .IX Item "-S"
175 Assume Shift_JIS and X0201 kana input. It also accepts \s-1JIS\s0.
176 EUC-JP is recognized as X0201 kana. Without \fB\-x\fR flag,
177 X0201 kana (halfwidth kana) is converted into X0208.
178 .IP "\fB\-E\fR" 4
179 .IX Item "-E"
180 Assume EUC-JP input. It also accepts \s-1JIS\s0.
181 Same as \-J.
182 .RE
183 .RS 4
184 .RE
185 .IP "\fB\-t\fR" 4
186 .IX Item "-t"
187 No conversion.
188 .IP "\fB\-i[@B]\fR" 4
189 .IX Item "-i[@B]"
190 Specify the Esc Seq for \s-1JIS\s0 X 0208\-1978/83. (\s-1DEFAULT\s0 B)
191 .IP "\fB\-o[\s-1BJH\s0]\fR" 4
192 .IX Item "-o[BJH]"
193 Specify the Esc Seq for ASCII/Roman. (\s-1DEFAULT\s0 B)
194 .IP "\fB\-r\fR" 4
195 .IX Item "-r"
196 {de/en}crypt \s-1ROT13/47\s0
197 .IP "\fB\-h[123] \-\-hiragana \-\-katakana \-\-katakana\-hiragana\fR" 4
198 .IX Item "-h[123] --hiragana --katakana --katakana-hiragana"
199 .RS 4
200 .PD 0
201 .IP "\fB\-h1 \-\-hiragana\fR" 4
202 .IX Item "-h1 --hiragana"
203 .PD
204 Katakana to Hiragana conversion.
205 .IP "\fB\-h2 \-\-katakana\fR" 4
206 .IX Item "-h2 --katakana"
207 Hiragana to Katakana conversion.
208 .IP "\fB\-h3 \-\-katakana\-hiragana\fR" 4
209 .IX Item "-h3 --katakana-hiragana"
210 Katakana to Hiragana and Hiragana to Katakana conversion.
211 .RE
212 .RS 4
213 .RE
214 .IP "\fB\-T\fR" 4
215 .IX Item "-T"
216 Text mode output (\s-1MS\-DOS\s0)
217 .IP "\fB\-l\fR" 4
218 .IX Item "-l"
219 \&\s-1ISO8859\-1\s0 (Latin\-1) support
220 .IP "\fB\-f[\f(BIm\fB [\- \f(BIn\fB]]\fR" 4
221 .IX Item "-f[m [- n]]"
222 Folding on \fIm\fR length with \fIn\fR margin in a line.
223 Without this option, fold length is 60 and fold margin is 10.
224 .IP "\fB\-F\fR" 4
225 .IX Item "-F"
226 New line preserving line folding.
227 .IP "\fB\-Z[0\-3]\fR" 4
228 .IX Item "-Z[0-3]"
229 Convert X0208 alphabet (Fullwidth Alphabets) to \s-1ASCII\s0.
230 .RS 4
231 .IP "\fB\-Z \-Z0\fR" 4
232 .IX Item "-Z -Z0"
233 Convert X0208 alphabet to \s-1ASCII\s0.
234 .IP "\fB\-Z1\fR" 4
235 .IX Item "-Z1"
236 Converts X0208 kankaku to single \s-1ASCII\s0 space.
237 .IP "\fB\-Z2\fR" 4
238 .IX Item "-Z2"
239 Converts X0208 kankaku to double \s-1ASCII\s0 spaces.
240 .IP "\fB\-Z3\fR" 4
241 .IX Item "-Z3"
242 Replacing Fullwidth >, <, ", & into '&gt;', '&lt;', '&quot;', '&amp;' as in \s-1HTML\s0.
243 .RE
244 .RS 4
245 .RE
246 .IP "\fB\-X \-x\fR" 4
247 .IX Item "-X -x"
248 Assume X0201 kana in MS\-Kanji.
249 With \fB\-X\fR or without this option, X0201 is converted into X0208 Kana.
250 With \fB\-x\fR, try to preserve X0208 kana and do not convert X0201 kana to X0208.
251 In \s-1JIS\s0 output, \s-1ESC\-\s0(\-I is used. In \s-1EUC\s0 output, \s-1SSO\s0 is used.
252 .IP "\fB\-B[0\-2]\fR" 4
253 .IX Item "-B[0-2]"
254 Assume broken JIS-Kanji input, which lost \s-1ESC\s0.
255 Useful when your site is using old B\-News Nihongo patch.
256 .RS 4
257 .IP "\fB\-B1\fR" 4
258 .IX Item "-B1"
259 allows any char after \s-1ESC\-\s0( or \s-1ESC\-$\s0.
260 .IP "\fB\-B2\fR" 4
261 .IX Item "-B2"
262 forces \s-1ASCII\s0 after \s-1NL\s0.
263 .RE
264 .RS 4
265 .RE
266 .IP "\fB\-I\fR" 4
267 .IX Item "-I"
268 Replacing non iso\-2022\-jp char into a geta character
269 (substitute character in Japanese).
270 .IP "\fB\-m[\s-1BQN0\s0]\fR" 4
271 .IX Item "-m[BQN0]"
272 \&\s-1MIME\s0 \s-1ISO\-2022\-JP/ISO8859\-1\s0 decode. (\s-1DEFAULT\s0)
273 To see \s-1ISO8859\-1\s0 (Latin\-1) \-l is necessary.
274 .RS 4
275 .IP "\fB\-mB\fR" 4
276 .IX Item "-mB"
277 Decode \s-1MIME\s0 base64 encoded stream. Remove header or other part before
278 conversion. 
279 .IP "\fB\-mQ\fR" 4
280 .IX Item "-mQ"
281 Decode \s-1MIME\s0 quoted stream. '_' in quoted stream is converted to space.
282 .IP "\fB\-mN\fR" 4
283 .IX Item "-mN"
284 Non-strict decoding.
285 It allows line break in the middle of the base64 encoding.
286 .IP "\fB\-m0\fR" 4
287 .IX Item "-m0"
288 No \s-1MIME\s0 decode.
289 .RE
290 .RS 4
291 .RE
292 .IP "\fB\-M\fR" 4
293 .IX Item "-M"
294 \&\s-1MIME\s0 encode. Header style. All \s-1ASCII\s0 code and control characters are intact.
295 .RS 4
296 .IP "\fB\-MB\fR" 4
297 .IX Item "-MB"
298 \&\s-1MIME\s0 encode Base64 stream.
299 Kanji conversion is performed before encoding, so this cannot be used as a picture encoder.
300 .IP "\fB\-MQ\fR" 4
301 .IX Item "-MQ"
302 Perfome quoted encoding.
303 .RE
304 .RS 4
305 .RE
306 .IP "\fB\-l\fR" 4
307 .IX Item "-l"
308 Input and output code is \s-1ISO8859\-1\s0 (Latin\-1) and \s-1ISO\-2022\-JP\s0.
309 \&\fB\-s\fR, \fB\-e\fR and \fB\-x\fR are not compatible with this option.
310 .IP "\fB\-L[uwm] \-d \-c\fR" 4
311 .IX Item "-L[uwm] -d -c"
312 Convert line breaks.
313 .RS 4
314 .IP "\fB\-Lu \-d\fR" 4
315 .IX Item "-Lu -d"
316 unix (\s-1LF\s0)
317 .IP "\fB\-Lw \-c\fR" 4
318 .IX Item "-Lw -c"
319 windows (\s-1CRLF\s0)
320 .IP "\fB\-Lm\fR" 4
321 .IX Item "-Lm"
322 mac (\s-1CR\s0)
323 .Sp
324 Without this option, nkf doesn't convert line breaks.
325 .RE
326 .RS 4
327 .RE
328 .IP "\fB\-\-fj \-\-unix \-\-mac \-\-msdos \-\-windows\fR" 4
329 .IX Item "--fj --unix --mac --msdos --windows"
330 convert for these system
331 .IP "\fB\-\-jis \-\-euc \-\-sjis \-\-mime \-\-base64\fR" 4
332 .IX Item "--jis --euc --sjis --mime --base64"
333 convert for named code
334 .IP "\fB\-\-jis\-input \-\-euc\-input \-\-sjis\-input \-\-mime\-input \-\-base64\-input\fR" 4
335 .IX Item "--jis-input --euc-input --sjis-input --mime-input --base64-input"
336 assume input system
337 .IP "\fB\-\-ic=\f(BIinput codeset\fB \-\-oc=\f(BIoutput codeset\fB\fR" 4
338 .IX Item "--ic=input codeset --oc=output codeset"
339 Set the input or output codeset.
340 \&\s-1NKF\s0 supports following codesets and those codeset name are case insensitive.
341 .RS 4
342 .IP "\s-1ISO\-2022\-JP\s0" 4
343 .IX Item "ISO-2022-JP"
344 a.k.a. \s-1RFC1468\s0, 7bit \s-1JIS\s0, \s-1JUNET\s0
345 .IP "EUC-JP (eucJP\-nkf)" 4
346 .IX Item "EUC-JP (eucJP-nkf)"
347 a.k.a. \s-1AT&T\s0 \s-1JIS\s0, Japanese \s-1EUC\s0, \s-1UJIS\s0
348 .IP "eucJP-ascii" 4
349 .IX Item "eucJP-ascii"
350 .PD 0
351 .IP "eucJP-ms" 4
352 .IX Item "eucJP-ms"
353 .IP "\s-1CP51932\s0" 4
354 .IX Item "CP51932"
355 .PD
356 Microsoft Version of \s-1EUC\-JP\s0.
357 .IP "Shift_JIS" 4
358 .IX Item "Shift_JIS"
359 a.k.a. \s-1SJIS\s0, MS-Kanji
360 .IP "\s-1CP932\s0" 4
361 .IX Item "CP932"
362 a.k.a. Windows\-31J
363 .IP "\s-1UTF\-8\s0" 4
364 .IX Item "UTF-8"
365 same as \s-1UTF\-8N\s0
366 .IP "\s-1UTF\-8N\s0" 4
367 .IX Item "UTF-8N"
368 \&\s-1UTF\-8\s0 without \s-1BOM\s0
369 .IP "\s-1UTF\-8\-BOM\s0" 4
370 .IX Item "UTF-8-BOM"
371 \&\s-1UTF\-8\s0 with \s-1BOM\s0
372 .IP "\s-1UTF\-16\s0" 4
373 .IX Item "UTF-16"
374 same as \s-1UTF\-16BE\s0
375 .IP "\s-1UTF\-16BE\s0" 4
376 .IX Item "UTF-16BE"
377 \&\s-1UTF\-16\s0 Big Endian without \s-1BOM\s0
378 .IP "\s-1UTF\-16BE\-BOM\s0" 4
379 .IX Item "UTF-16BE-BOM"
380 \&\s-1UTF\-16\s0 Big Endian with \s-1BOM\s0
381 .IP "\s-1UTF\-16LE\s0" 4
382 .IX Item "UTF-16LE"
383 \&\s-1UTF\-16\s0 Little Endian without \s-1BOM\s0
384 .IP "\s-1UTF\-16LE\-BOM\s0" 4
385 .IX Item "UTF-16LE-BOM"
386 \&\s-1UTF\-16\s0 Little Endian with \s-1BOM\s0
387 .IP "\s-1UTF8\-MAC\s0 (input only)" 4
388 .IX Item "UTF8-MAC (input only)"
389 .RE
390 .RS 4
391 .RE
392 .PD 0
393 .IP "\fB\-\-fb\-{skip, html, xml, perl, java, subchar}\fR" 4
394 .IX Item "--fb-{skip, html, xml, perl, java, subchar}"
395 .PD
396 Specify the way that nkf handles unassigned characters.
397 Without this option, \-\-fb\-skip is assumed.
398 .IP "\fB\-\-prefix=\f(BIescape character\fB\f(BItarget character\fB..\fR" 4
399 .IX Item "--prefix=escape charactertarget character.."
400 When nkf converts to Shift_JIS,
401 nkf adds a specified escape character to specified 2nd byte of Shift_JIS characters.
402 1st byte of argument is the escape character and following bytes are target characters.
403 .IP "\fB\-\-no\-cp932ext\fR" 4
404 .IX Item "--no-cp932ext"
405 Handle the characters extended in \s-1CP932\s0 as unassigned characters.
406 .IP "\fB\-\-no\-best\-fit\-chars\fR" 4
407 .IX Item "--no-best-fit-chars"
408 When Unicode to Encoded byte conversion,
409 don't convert characters which is not round trip safe.
410 When Unicode to Unicode conversion,
411 with this and \-x option, nkf can be used as \s-1UTF\s0 converter.
412 (In other words, without this and \-x option, nkf doesn't save some characters)
413 .Sp
414 When nkf convert string which related to path, you should use this opion.
415 .IP "\fB\-\-cap\-input\fR" 4
416 .IX Item "--cap-input"
417 Decode hex encoded characters.
418 .IP "\fB\-\-url\-input\fR" 4
419 .IX Item "--url-input"
420 Unescape percent escaped characters.
421 .IP "\fB\-\-numchar\-input\fR" 4
422 .IX Item "--numchar-input"
423 Decode character reference, such as \*(L"&#....;\*(R".
424 .IP "\fB\-\-in\-place[=\fR\fI\s-1SUFFIX\s0\fR\fB]\fR  \fB\-\-overwrite[=\fR\fI\s-1SUFFIX\s0\fR\fB]\fR" 4
425 .IX Item "--in-place[=SUFFIX]  --overwrite[=SUFFIX]"
426 Overwrite \fBoriginal\fR listed files by filtered result.
427 .Sp
428 \&\fBNote\fR \-\-overwrite preserves timestamp of original files.
429 .IP "\fB\-\-guess\fR" 4
430 .IX Item "--guess"
431 Print guessed encoding.
432 .IP "\fB\-\-help\fR" 4
433 .IX Item "--help"
434 Print nkf's help.
435 .IP "\fB\-\-version\fR" 4
436 .IX Item "--version"
437 Print nkf's version.
438 .IP "\fB\-\-\fR" 4
439 .IX Item "--"
440 Ignore rest of \-option.
441 .SH "AUTHOR"
442 .IX Header "AUTHOR"
443 Copyright (C) 1987, \s-1FUJITSU\s0 \s-1LTD\s0. (I.Ichikawa),2000 S. Kono, \s-1COW\s0
444 Copyright (C) 2002\-2006 Kono, Furukawa, Naruse, mastodon