1nkf(1)                                                                  nkf(1)
2
3
4

NAME

6       nkf - Network Kanji Filter
7

SYNOPSIS

9       nkf [-butjnesliohrTVvwWJESZxXFfmMBOcdILg] [file ...]
10

DESCRIPTION

12       Nkf is a yet another kanji code converter among networks, hosts and
13       terminals.  It converts input kanji code to designated kanji code such
14       as ISO-2022-JP, Shift_JIS, EUC-JP, UTF-8 or UTF-16.
15
16       One of the most unique faculty of nkf is the guess of the input kanji
17       encodings.  It currently recognizes ISO-2022-JP, Shift_JIS, EUC-JP,
18       UTF-8 and UTF-16.  So users needn't set the input kanji code explic‐
19       itly.
20
21       By default, X0201 kana is converted into X0208 kana.  For X0201 kana,
22       SO/SI, SSO and ESC-(-I methods are supported.  For automatic code
23       detection, nkf assumes no X0201 kana in Shift_JIS.  To accept X0201 in
24       Shift_JIS, use -X, -x or -S.
25

OPTIONS

27       -b -u
28           Output is buffered (DEFAULT), Output is unbuffered.
29
30       -j -s -e -w -w16
31           Output code is ISO-2022-JP (7bit JIS), Shift_JIS, EUC-JP, UTF-8N,
32           UTF-16BE.  Without this option and compile option, ISO-2022-JP is
33           assumed.
34
35       -J -S -E -W -W16
36           Input assumption is JIS 7 bit, Shift_JIS, EUC-JP, UTF-8, UTF-16LE.
37
38           -J  Assume  JIS input. It also accepts EUC-JP.  This is the
39               default. This flag does not exclude Shift_JIS.
40
41           -S  Assume Shift_JIS and X0201 kana input. It also accepts JIS.
42               EUC-JP is recognized as X0201 kana. Without -x flag, X0201 kana
43               (halfwidth kana) is converted into X0208.
44
45           -E  Assume EUC-JP input. It also accepts JIS.  Same as -J.
46
47       -t  No conversion.
48
49       -i[@B]
50           Specify the Esc Seq for JIS X 0208-1978/83. (DEFAULT B)
51
52       -o[BJH]
53           Specify the Esc Seq for ASCII/Roman. (DEFAULT B)
54
55       -r  {de/en}crypt ROT13/47
56
57       -h[123] --hiragana --katakana --katakana-hiragana
58           -h1 --hiragana
59               Katakana to Hiragana conversion.
60
61           -h2 --katakana
62               Hiragana to Katakana conversion.
63
64           -h3 --katakana-hiragana
65               Katakana to Hiragana and Hiragana to Katakana conversion.
66
67       -T  Text mode output (MS-DOS)
68
69       -l  ISO8859-1 (Latin-1) support
70
71       -f[m [- n]]
72           Folding on m length with n margin in a line.  Without this option,
73           fold length is 60 and fold margin is 10.
74
75       -F  New line preserving line folding.
76
77       -Z[0-3]
78           Convert X0208 alphabet (Fullwidth Alphabets) to ASCII.
79
80           -Z -Z0
81               Convert X0208 alphabet to ASCII.
82
83           -Z1 Converts X0208 kankaku to single ASCII space.
84
85           -Z2 Converts X0208 kankaku to double ASCII spaces.
86
87           -Z3 Replacing Fullwidth >, <, ", & into '&gt;', '&lt;', '&quot;',
88               '&amp;' as in HTML.
89
90       -X -x
91           Assume X0201 kana in MS-Kanji.  With -X or without this option,
92           X0201 is converted into X0208 Kana.  With -x, try to preserve X0208
93           kana and do not convert X0201 kana to X0208.  In JIS output,
94           ESC-(-I is used. In EUC output, SSO is used.
95
96       -B[0-2]
97           Assume broken JIS-Kanji input, which lost ESC.  Useful when your
98           site is using old B-News Nihongo patch.
99
100           -B1 allows any char after ESC-( or ESC-$.
101
102           -B2 forces ASCII after NL.
103
104       -I  Replacing non iso-2022-jp char into a geta character (substitute
105           character in Japanese).
106
107       -m[BQN0]
108           MIME ISO-2022-JP/ISO8859-1 decode. (DEFAULT) To see ISO8859-1
109           (Latin-1) -l is necessary.
110
111           -mB Decode MIME base64 encoded stream. Remove header or other part
112               before conversion.
113
114           -mQ Decode MIME quoted stream. '_' in quoted stream is converted to
115               space.
116
117           -mN Non-strict decoding.  It allows line break in the middle of the
118               base64 encoding.
119
120           -m0 No MIME decode.
121
122       -M  MIME encode. Header style. All ASCII code and control characters
123           are intact.
124
125           -MB MIME encode Base64 stream.  Kanji conversion is performed
126               before encoding, so this cannot be used as a picture encoder.
127
128           -MQ Perfome quoted encoding.
129
130       -l  Input and output code is ISO8859-1 (Latin-1) and ISO-2022-JP.  -s,
131           -e and -x are not compatible with this option.
132
133       -L[uwm] -d -c
134           Convert line breaks.
135
136           -Lu -d
137               unix (LF)
138
139           -Lw -c
140               windows (CRLF)
141
142           -Lm mac (CR)
143
144               Without this option, nkf doesn't convert line breaks.
145
146       --fj --unix --mac --msdos --windows
147           convert for these system
148
149       --jis --euc --sjis --mime --base64
150           convert for named code
151
152       --jis-input --euc-input --sjis-input --mime-input --base64-input
153           assume input system
154
155       --ic=input codeset --oc=output codeset
156           Set the input or output codeset.  NKF supports following codesets
157           and those codeset name are case insensitive.
158
159           ISO-2022-JP
160               a.k.a. RFC1468, 7bit JIS, JUNET
161
162           EUC-JP (eucJP-nkf)
163               a.k.a. AT&T JIS, Japanese EUC, UJIS
164
165           eucJP-ascii
166           eucJP-ms
167           CP51932
168               Microsoft Version of EUC-JP.
169
170           Shift_JIS
171               a.k.a. SJIS, MS-Kanji
172
173           CP932
174               a.k.a. Windows-31J
175
176           UTF-8
177               same as UTF-8N
178
179           UTF-8N
180               UTF-8 without BOM
181
182           UTF-8-BOM
183               UTF-8 with BOM
184
185           UTF8-MAC (input only)
186               decomposed UTF-8
187
188           UTF-16
189               same as UTF-16BE
190
191           UTF-16BE
192               UTF-16 Big Endian without BOM
193
194           UTF-16BE-BOM
195               UTF-16 Big Endian with BOM
196
197           UTF-16LE
198               UTF-16 Little Endian without BOM
199
200           UTF-16LE-BOM
201               UTF-16 Little Endian with BOM
202
203       --fb-{skip, html, xml, perl, java, subchar}
204           Specify the way that nkf handles unassigned characters.  Without
205           this option, --fb-skip is assumed.
206
207       --prefix=escape charactertarget character..
208           When nkf converts to Shift_JIS, nkf adds a specified escape charac‐
209           ter to specified 2nd byte of Shift_JIS characters.  1st byte of
210           argument is the escape character and following bytes are target
211           characters.
212
213       --no-cp932ext
214           Handle the characters extended in CP932 as unassigned characters.
215
216       --no-best-fit-chars
217           When Unicode to Encoded byte conversion, don't convert characters
218           which is not round trip safe.  When Unicode to Unicode conversion,
219           with this and -x option, nkf can be used as UTF converter.  (In
220           other words, without this and -x option, nkf doesn't save some
221           characters)
222
223           When nkf convert string which related to path, you should use this
224           opion.
225
226       --cap-input
227           Decode hex encoded characters.
228
229       --url-input
230           Unescape percent escaped characters.
231
232       --numchar-input
233           Decode character reference, such as "&#....;".
234
235       --in-place[=SUFFIX]  --overwrite[=SUFFIX]
236           Overwrite original listed files by filtered result.
237
238           Note --overwrite preserves timestamp of original files.
239
240       --guess
241           Print guessed encoding.
242
243       --help
244           Print nkf's help.
245
246       --version
247           Print nkf's version.
248
249       --  Ignore rest of -option.
250

AUTHOR

252       Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW Copy‐
253       right (C) 2002-2006 Kono, Furukawa, Naruse, mastodon
254
255
256
257nkf 2.0.8                         2006-08-22                            nkf(1)
Impressum