OSDN Git Service

* NKF.mod/NKF.pm: fix document [nkf-bugs#8614]
[nkf/nkf.git] / man / nkf.1.pm
1 ## Copyright (C) 1996,1998
2 ## Copyright (C) 2002
3 ## Ï¢ÍíÀ衧 Î°µåÂç³Ø¾ðÊ󹩳زʠ²ÏÌî ¿¿¼£  mime/X0208 support
4 ## ¡ÊE-Mail Address: kono@ie.u-ryukyu.ac.jp¡Ë
5 ## Ï¢ÍíÀ衧 COW for DOS & Win16 & Win32 & OS/2
6 ## ¡ÊE-Mail Address: GHG00637@niftyserve.or.p¡Ë
7 ##    
8 ##    ¤³¤Î¥½¡¼¥¹¤Î¤¤¤«¤Ê¤ëÊ£¼Ì¡¤²þÊÑ¡¤½¤Àµ¤âµöÂú¤·¤Þ¤¹¡£¤¿¤À¤·¡¢
9 ##    ¤½¤ÎºÝ¤Ë¤Ï¡¢Ã¯¤¬¹×¸¥¤·¤¿¤ò¼¨¤¹¤³¤ÎÉôʬ¤ò»Ä¤¹¤³¤È¡£
10 ##    ºÆÇÛÉۤ仨»ï¤ÎÉÕÏ¿¤Ê¤É¤ÎÌ䤤¹ç¤ï¤»¤âɬÍפ¢¤ê¤Þ¤»¤ó¡£
11 ##    ±ÄÍøÍøÍѤâ¾åµ­¤ËÈ¿¤·¤Ê¤¤ÈϰϤǵö²Ä¤·¤Þ¤¹¡£
12 ##    ¥Ð¥¤¥Ê¥ê¤ÎÇÛÉۤκݤˤÏversion message¤òÊݸ¤¹¤ë¤³¤È¤ò¾ò·ï¤È¤·¤Þ¤¹¡£
13 ##    ¤³¤Î¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ¤ÏÆä˲¿¤ÎÊݾڤ⤷¤Ê¤¤¡¢°­¤·¤«¤é¤º¡£
14 ##    
15 ##    Everyone is permitted to do anything on this program
16 ##    including copying, modifying, improving, 
17 ##    as long as you don't try to pretend that you wrote it.
18 ##    i.e., the above copyright notice has to appear in all copies.  
19 ##    Binar y distribution requires original version messages.
20 ##    You don't have to ask before copying, redistribution or publishing.
21 ##    THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE.
22
23
24 package NKF;
25
26 use strict;
27 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
28
29 require Exporter;
30 require DynaLoader;
31
32 @ISA = qw(Exporter DynaLoader);
33 # Items to export into callers namespace by default. Note: do not export
34 # names by default without a very good reason. Use EXPORT_OK instead.
35 # Do not simply export all your public functions/methods/constants.
36 @EXPORT = qw(
37         nkf     nkf_continue    inputcode
38 );
39 $VERSION = '2.08';
40
41 bootstrap NKF $VERSION;
42
43 # Preloaded methods go here.
44
45 # Autoload methods go after =cut, and are processed by the autosplit program.
46
47 1;
48 __END__
49
50 #
51
52
53 =head1 NAME
54
55
56 nkf - Network Kanji Filter
57
58
59 =head1 SYNOPSIS
60
61
62 nkf B<[-butjnesliohrTVvwWJESZxXFfmMBOcdILg]> B<[>I<file ...>B<]>
63
64
65 =head1 DESCRIPTION
66
67
68 B<Nkf> is a yet another kanji code converter among networks, hosts and terminals.
69 It converts input kanji code to designated kanji code
70 such as ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8 or UTF-16.
71
72 One of the most unique faculty of B<nkf> is the guess of the input kanji encodings.
73 It currently recognizes ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8 and UTF-16.
74 So users needn't set the input kanji code explicitly.
75
76 By default, X0201 kana is converted into X0208 kana.
77 For X0201 kana, SO/SI, SSO and ESC-(-I methods are supported.
78 For automatic code detection, nkf assumes no X0201 kana in Shift_JIS.
79 To accept X0201 in Shift_JIS, use B<-X>, B<-x> or B<-S>.
80
81 =head1 OPTIONS
82
83 =over
84
85 =item B<-b -u>
86
87 Output is buffered (DEFAULT), Output is unbuffered.
88
89 =item B<-j -s -e -w -w16>
90
91 Output code is ISO-2022-JP (7bit JIS), Shift_JIS, EUC-JP,
92 UTF-8N, UTF-16BE.
93 Without this option and compile option, ISO-2022-JP is assumed.
94
95 =item B<-J -S -E -W -W16>
96
97 Input assumption is JIS 7 bit, Shift_JIS, EUC-JP,
98 UTF-8, UTF-16LE.
99
100 =over
101
102 =item B<-J>
103
104 Assume  JIS input. It also accepts EUC-JP.
105 This is the default. This flag does not exclude Shift_JIS.
106
107 =item B<-S>
108
109 Assume Shift_JIS and X0201 kana input. It also accepts JIS.
110 EUC-JP is recognized as X0201 kana. Without B<-x> flag,
111 X0201 kana (halfwidth kana) is converted into X0208.
112
113 =item B<-E>
114
115 Assume EUC-JP input. It also accepts JIS.
116 Same as -J.
117
118 =back
119
120 =item B<-t>
121
122 No conversion.
123
124 =item B<-i[@B]>
125
126 Specify the Esc Seq for JIS X 0208-1978/83. (DEFAULT B)
127
128 =item B<-o[BJH]>
129
130 Specify the Esc Seq for ASCII/Roman. (DEFAULT B)
131
132 =item B<-r>
133
134 {de/en}crypt ROT13/47
135
136 =item B<-h[123] --hiragana --katakana --katakana-hiragana>
137
138 =over
139
140 =item B<-h1 --hiragana>
141
142 Katakana to Hiragana conversion.
143
144 =item B<-h2 --katakana>
145
146 Hiragana to Katakana conversion.
147
148 =item B<-h3 --katakana-hiragana>
149
150 Katakana to Hiragana and Hiragana to Katakana conversion.
151
152 =back
153
154 =item B<-T>
155
156 Text mode output (MS-DOS)
157
158 =item B<-l>
159
160 ISO8859-1 (Latin-1) support
161
162 =item B<-f[I<m> [- I<n>]]>
163
164 Folding on I<m> length with I<n> margin in a line.
165 Without this option, fold length is 60 and fold margin is 10.
166
167 =item B<-F>
168
169 New line preserving line folding.
170
171 =item B<-Z[0-3]>
172
173 Convert X0208 alphabet (Fullwidth Alphabets) to ASCII.
174
175 =over
176
177 =item B<-Z -Z0>
178
179 Convert X0208 alphabet to ASCII.
180
181 =item B<-Z1>
182
183 Converts X0208 kankaku to single ASCII space.
184
185 =item B<-Z2>
186
187 Converts X0208 kankaku to double ASCII spaces.
188
189 =item B<-Z3>
190
191 Replacing Fullwidth >, <, ", & into '&gt;', '&lt;', '&quot;', '&amp;' as in HTML.
192
193 =back
194
195 =item B<-X -x>
196
197 Assume X0201 kana in MS-Kanji.
198 With B<-X> or without this option, X0201 is converted into X0208 Kana.
199 With B<-x>, try to preserve X0208 kana and do not convert X0201 kana to X0208.
200 In JIS output, ESC-(-I is used. In EUC output, SSO is used.
201
202 =item B<-B[0-2]>
203
204 Assume broken JIS-Kanji input, which lost ESC.
205 Useful when your site is using old B-News Nihongo patch.
206
207 =over
208
209 =item B<-B1>
210
211 allows any char after ESC-( or ESC-$.
212
213 =item B<-B2>
214
215 forces ASCII after NL.
216
217 =back
218
219 =item B<-I>
220
221 Replacing non iso-2022-jp char into a geta character
222 (substitute character in Japanese).
223
224 =item B<-m[BQN0]>
225
226 MIME ISO-2022-JP/ISO8859-1 decode. (DEFAULT)
227 To see ISO8859-1 (Latin-1) -l is necessary.
228
229 =over
230
231 =item B<-mB>
232
233 Decode MIME base64 encoded stream. Remove header or other part before
234 conversion. 
235
236 =item B<-mQ>
237
238 Decode MIME quoted stream. '_' in quoted stream is converted to space.
239
240 =item B<-mN>
241
242 Non-strict decoding.
243 It allows line break in the middle of the base64 encoding.
244
245 =item B<-m0>
246
247 No MIME decode.
248
249 =back
250
251 =item B<-M>
252
253 MIME encode. Header style. All ASCII code and control characters are intact.
254
255 =over
256
257 =item B<-MB>
258
259 MIME encode Base64 stream.
260 Kanji conversion is performed before encoding, so this cannot be used as a picture encoder.
261
262 =item B<-MQ>
263
264 Perfome quoted encoding.
265
266 =back
267
268 =item B<-l>
269
270 Input and output code is ISO8859-1 (Latin-1) and ISO-2022-JP.
271 B<-s>, B<-e> and B<-x> are not compatible with this option.
272
273 =item B<-L[uwm] -d -c>
274
275 Convert line breaks.
276
277 =over
278
279 =item B<-Lu -d>
280
281 unix (LF)
282
283 =item B<-Lw -c>
284
285 windows (CRLF)
286
287 =item B<-Lm>
288
289 mac (CR)
290
291 Without this option, nkf doesn't convert line breaks.
292
293 =back
294
295 =item B<--fj --unix --mac --msdos --windows>
296
297 convert for these system
298
299 =item B<--jis --euc --sjis --mime --base64>
300
301 convert for named code
302
303 =item B<--jis-input --euc-input --sjis-input --mime-input --base64-input>
304
305 assume input system
306
307 =item B<--ic=I<input codeset> --oc=I<output codeset>>
308
309 Set the input or output codeset.
310 NKF supports following codesets and those codeset name are case insensitive.
311
312 =over
313
314 =item ISO-2022-JP
315
316 a.k.a. RFC1468, 7bit JIS, JUNET
317
318 =item EUC-JP (eucJP-nkf)
319
320 a.k.a. AT&T JIS, Japanese EUC, UJIS
321
322 =item eucJP-ascii
323
324 =item eucJP-ms
325
326 =item CP51932
327
328 Microsoft Version of EUC-JP.
329
330 =item Shift_JIS
331
332 a.k.a. SJIS, MS-Kanji
333
334 =item CP932
335
336 a.k.a. Windows-31J
337
338 =item UTF-8
339
340 same as UTF-8N
341
342 =item UTF-8N
343
344 UTF-8 without BOM
345
346 =item UTF-8-BOM
347
348 UTF-8 with BOM
349
350 =item UTF8-MAC (input only)
351
352 decomposed UTF-8
353
354 =item UTF-16
355
356 same as UTF-16BE
357
358 =item UTF-16BE
359
360 UTF-16 Big Endian without BOM
361
362 =item UTF-16BE-BOM
363
364 UTF-16 Big Endian with BOM
365
366 =item UTF-16LE
367
368 UTF-16 Little Endian without BOM
369
370 =item UTF-16LE-BOM
371
372 UTF-16 Little Endian with BOM
373
374 =back
375
376 =item B<--fb-{skip, html, xml, perl, java, subchar}>
377
378 Specify the way that nkf handles unassigned characters.
379 Without this option, --fb-skip is assumed.
380
381 =item B<--prefix=I<escape character>I<target character>..>
382
383 When nkf converts to Shift_JIS,
384 nkf adds a specified escape character to specified 2nd byte of Shift_JIS characters.
385 1st byte of argument is the escape character and following bytes are target characters.
386
387 =item B<--no-cp932ext>
388
389 Handle the characters extended in CP932 as unassigned characters.
390
391 =item B<--no-best-fit-chars>
392
393 When Unicode to Encoded byte conversion,
394 don't convert characters which is not round trip safe.
395 When Unicode to Unicode conversion,
396 with this and -x option, nkf can be used as UTF converter.
397 (In other words, without this and -x option, nkf doesn't save some characters)
398
399 When nkf convert string which related to path, you should use this opion.
400
401 =item B<--cap-input>
402
403 Decode hex encoded characters.
404
405 =item B<--url-input>
406
407 Unescape percent escaped characters.
408
409 =item B<--numchar-input>
410
411 Decode character reference, such as "&#....;".
412
413
414 =item B<--in-place[=>I<SUFFIX>B<]>  B<--overwrite[=>I<SUFFIX>B<]>
415
416 Overwrite B<original> listed files by filtered result.
417
418 B<Note> --overwrite preserves timestamp of original files.
419
420 =item B<--guess>
421
422 Print guessed encoding.
423
424 =item B<--help>
425
426 Print nkf's help.
427
428 =item B<--version>
429
430 Print nkf's version.
431
432
433 =item B<-->
434
435 Ignore rest of -option.
436
437 =back
438
439 =head1 AUTHOR
440
441 Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW
442 Copyright (C) 2002-2006 Kono, Furukawa, Naruse, mastodon
443
444
445 =cut