OSDN Git Service

65dec1abb313d8895ed9acbe2925530ec3300637
[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.
105 This is the default.
106
107 =item B<-S>
108
109 Assume Shift_JIS and X0201 kana input.
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.
116
117 =back
118
119 =item B<-t>
120
121 No conversion.
122
123 =item B<-i[@B]>
124
125 Specify the Esc Seq for JIS X 0208-1978/83. (DEFAULT B)
126
127 =item B<-o[BJH]>
128
129 Specify the Esc Seq for ASCII/Roman. (DEFAULT B)
130
131 =item B<-r>
132
133 {de/en}crypt ROT13/47
134
135 =item B<-h[123] --hiragana --katakana --katakana-hiragana>
136
137 =over
138
139 =item B<-h1 --hiragana>
140
141 Katakana to Hiragana conversion.
142
143 =item B<-h2 --katakana>
144
145 Hiragana to Katakana conversion.
146
147 =item B<-h3 --katakana-hiragana>
148
149 Katakana to Hiragana and Hiragana to Katakana conversion.
150
151 =back
152
153 =item B<-T>
154
155 Text mode output (MS-DOS)
156
157 =item B<-l>
158
159 ISO8859-1 (Latin-1) support
160
161 =item B<-f[I<m> [- I<n>]]>
162
163 Folding on I<m> length with I<n> margin in a line.
164 Without this option, fold length is 60 and fold margin is 10.
165
166 =item B<-F>
167
168 New line preserving line folding.
169
170 =item B<-Z[0-3]>
171
172 Convert X0208 alphabet (Fullwidth Alphabets) to ASCII.
173
174 =over
175
176 =item B<-Z -Z0>
177
178 Convert X0208 alphabet to ASCII.
179
180 =item B<-Z1>
181
182 Convert X0208 kankaku to single ASCII space.
183
184 =item B<-Z2>
185
186 Convert X0208 kankaku to double ASCII spaces.
187
188 =item B<-Z3>
189
190 Replacing fullwidth >, <, ", & into '&gt;', '&lt;', '&quot;', '&amp;' as in HTML.
191
192 =back
193
194 =item B<-X -x>
195
196 Assume X0201 kana in MS-Kanji.
197 With B<-X> or without this option, X0201 is converted into X0208 Kana.
198 With B<-x>, try to preserve X0208 kana and do not convert X0201 kana to X0208.
199 In JIS output, ESC-(-I is used. In EUC output, SSO is used.
200
201 =item B<-B[0-2]>
202
203 Assume broken JIS-Kanji input, which lost ESC.
204 Useful when your site is using old B-News Nihongo patch.
205
206 =over
207
208 =item B<-B1>
209
210 allows any chars after ESC-( or ESC-$.
211
212 =item B<-B2>
213
214 force ASCII after NL.
215
216 =back
217
218 =item B<-I>
219
220 Replacing non iso-2022-jp char into a geta character
221 (substitute character in Japanese).
222
223 =item B<-m[BQN0]>
224
225 MIME ISO-2022-JP/ISO8859-1 decode. (DEFAULT)
226 To see ISO8859-1 (Latin-1) -l is necessary.
227
228 =over
229
230 =item B<-mB>
231
232 Decode MIME base64 encoded stream. Remove header or other part before
233 conversion. 
234
235 =item B<-mQ>
236
237 Decode MIME quoted stream. '_' in quoted stream is converted to space.
238
239 =item B<-mN>
240
241 Non-strict decoding.
242 It allows line break in the middle of the base64 encoding.
243
244 =item B<-m0>
245
246 No MIME decode.
247
248 =back
249
250 =item B<-M>
251
252 MIME encode. Header style. All ASCII code and control characters are intact.
253
254 =over
255
256 =item B<-MB>
257
258 MIME encode Base64 stream.
259 Kanji conversion is performed before encoding, so this cannot be used as a picture encoder.
260
261 =item B<-MQ>
262
263 Perform quoted encoding.
264
265 =back
266
267 =item B<-l>
268
269 Input and output code is ISO8859-1 (Latin-1) and ISO-2022-JP.
270 B<-s>, B<-e> and B<-x> are not compatible with this option.
271
272 =item B<-L[uwm] -d -c>
273
274 Convert line breaks.
275
276 =over
277
278 =item B<-Lu -d>
279
280 unix (LF)
281
282 =item B<-Lw -c>
283
284 windows (CRLF)
285
286 =item B<-Lm>
287
288 mac (CR)
289
290 Without this option, nkf doesn't convert line breaks.
291
292 =back
293
294 =item B<--fj --unix --mac --msdos --windows>
295
296 Convert for these systems.
297
298 =item B<--jis --euc --sjis --mime --base64>
299
300 Convert to named code.
301
302 =item B<--jis-input --euc-input --sjis-input --mime-input --base64-input>
303
304 Assume input system
305
306 =item B<--ic=I<input codeset> --oc=I<output codeset>>
307
308 Set the input or output codeset.
309 NKF supports following codesets and those codeset names are case insensitive.
310
311 =over
312
313 =item ISO-2022-JP
314
315 a.k.a. RFC1468, 7bit JIS, JUNET
316
317 =item EUC-JP (eucJP-nkf)
318
319 a.k.a. AT&T JIS, Japanese EUC, UJIS
320
321 =item eucJP-ascii
322
323 =item eucJP-ms
324
325 =item CP51932
326
327 Microsoft Version of EUC-JP.
328
329 =item Shift_JIS
330
331 a.k.a. SJIS, MS-Kanji
332
333 =item Windows-31J
334
335 a.k.a. CP932
336
337 =item UTF-8
338
339 same as UTF-8N
340
341 =item UTF-8N
342
343 UTF-8 without BOM
344
345 =item UTF-8-BOM
346
347 UTF-8 with BOM
348
349 =item UTF8-MAC (input only)
350
351 decomposed UTF-8
352
353 =item UTF-16
354
355 same as UTF-16BE
356
357 =item UTF-16BE
358
359 UTF-16 Big Endian without BOM
360
361 =item UTF-16BE-BOM
362
363 UTF-16 Big Endian with BOM
364
365 =item UTF-16LE
366
367 UTF-16 Little Endian without BOM
368
369 =item UTF-16LE-BOM
370
371 UTF-16 Little Endian with BOM
372
373 =back
374
375 =item B<--fb-{skip, html, xml, perl, java, subchar}>
376
377 Specify the way that nkf handles unassigned characters.
378 Without this option, --fb-skip is assumed.
379
380 =item B<--prefix=I<escape character>I<target character>..>
381
382 When nkf converts to Shift_JIS,
383 nkf adds a specified escape character to specified 2nd byte of Shift_JIS characters.
384 1st byte of argument is the escape character and following bytes are target characters.
385
386 =item B<--no-cp932ext>
387
388 Handle the characters extended in CP932 as unassigned characters.
389
390 =item B<--no-best-fit-chars>
391
392 When Unicode to Encoded byte conversion,
393 don't convert characters which is not round trip safe.
394 When Unicode to Unicode conversion,
395 with this and -x option, nkf can be used as UTF converter.
396 (In other words, without this and -x option, nkf doesn't save some characters)
397
398 When nkf converts strings that related to path, you should use this opion.
399
400 =item B<--cap-input>
401
402 Decode hex encoded characters.
403
404 =item B<--url-input>
405
406 Unescape percent escaped characters.
407
408 =item B<--numchar-input>
409
410 Decode character reference, such as "&#....;".
411
412
413 =item B<--in-place[=>I<SUFFIX>B<]>  B<--overwrite[=>I<SUFFIX>B<]>
414
415 Overwrite B<original> listed files by filtered result.
416
417 B<Note> --overwrite preserves timestamps of original files.
418
419 =item B<--guess=[12]>
420
421 Print guessed encoding and newline. (2 is default, 1 is only encoding)
422
423 =item B<--help>
424
425 Print nkf's help.
426
427 =item B<--version>
428
429 Print nkf's version.
430
431
432 =item B<-->
433
434 Ignore rest of -option.
435
436 =back
437
438 =head1 AUTHOR
439
440 Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW
441 Copyright (C) 2002-2007 Kono, Furukawa, Naruse, mastodon
442
443
444 =cut