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