Network kanji filter
nkf [-butjnesliohrTVvwWJESZxXFfmMBOcdILg] [file ...]
Nkf is a yet another kanji code converter among networks, hosts and terminals. It converts input kanji code to designated kanji code such as \s-1ISO-2022-JP\s0, Shift_JIS, EUC-JP, \s-1UTF-8\s0, \s-1UTF-16\s0 or \s-1UTF-32\s0.
One of the most unique faculty of nkf is the guess of the input kanji encodings. It currently recognizes \s-1ISO-2022-JP\s0, Shift_JIS, EUC-JP, \s-1UTF-8\s0, \s-1UTF-16\s0 and \s-1UTF-32\s0. So users needn't set the input kanji code explicitly.
By default, X0201 kana is converted into X0208 kana. For X0201 kana, \s-1SO/SI\s0, \s-1SSO\s0 and \s-1ESC-\s0(-I methods are supported. For automatic code detection, nkf assumes no X0201 kana in Shift_JIS. To accept X0201 in Shift_JIS, use -X, -x or -S.
Specify input and output encodings. Upper case is input. cf. --ic and --oc.
\s-1ISO-2022-JP\s0 (\s-1JIS\s0 code).
Shift_JIS and \s-1JIS\s0 X 0201 kana. EUC-JP is recognized as X0201 kana. Without -x flag, \s-1JIS\s0 X 0201 Katakana (a.k.a.halfwidth kana) is converted into \s-1JIS\s0 X 0208. If you use Windows, see Windows-31J (\s-1CP932\s0).
EUC-JP.
\s-1UTF-8N\s0.
\s-1UTF-16\s0. B or L gives whether Big Endian or Little Endian. 0 gives whther put \s-1BOM\s0 or not.
\s-1UTF-32\s0. B or L gives whether Big Endian or Little Endian. 0 gives whther put \s-1BOM\s0 or not.
Output is buffered (\s-1DEFAULT\s0), Output is unbuffered.
No conversion.
Specify the escape sequence for \s-1JIS\s0 X 0208.
Use \s-1ESC\s0 ( @. (\s-1JIS\s0 X 0208-1978)
Use \s-1ESC\s0 ( B. (\s-1JIS\s0 X 0208-1983/1990 \s-1DEFAULT\s0)
Specify the escape sequence for \s-1US-ASCII/JIS\s0 X 0201 Roman. (\s-1DEFAULT\s0 B)
{de/en}crypt \s-1ROT13/47\s0
Katakana to Hiragana conversion.
Hiragana to Katakana conversion.
Katakana to Hiragana and Hiragana to Katakana conversion.
Text mode output (MS-DOS)
Folding on m length with n margin in a line. Without this option, fold length is 60 and fold margin is 10.
New line preserving line folding.
Convert X0208 alphabet (Fullwidth Alphabets) to \s-1ASCII\s0.
Convert X0208 alphabet to \s-1ASCII\s0.
Convert X0208 kankaku to single \s-1ASCII\s0 space.
Convert X0208 kankaku to double \s-1ASCII\s0 spaces.
Replacing fullwidth >, <, ", & into '>', '<', '"', '&' as in \s-1HTML\s0.
With -X or without this option, X0201 is converted into X0208 Kana. With -x, try to preserve X0208 kana and do not convert X0201 kana to X0208. In \s-1JIS\s0 output, \s-1ESC-\s0(-I is used. In \s-1EUC\s0 output, \s-1SS2\s0 is used.
Assume broken JIS-Kanji input, which lost \s-1ESC\s0. Useful when your site is using old B-News Nihongo patch.
allows any chars after \s-1ESC-\s0( or \s-1ESC-$\s0.
force \s-1ASCII\s0 after \s-1NL\s0.
Replacing non iso-2022-jp char into a geta character (substitute character in Japanese).
\s-1MIME\s0 \s-1ISO-2022-JP/ISO8859-1\s0 decode. (\s-1DEFAULT\s0) To see \s-1ISO8859-1\s0 (Latin-1) -l is necessary.
Decode \s-1MIME\s0 base64 encoded stream. Remove header or other part before conversion.
Decode \s-1MIME\s0 quoted stream. '_' in quoted stream is converted to space.
Non-strict decoding. It allows line break in the middle of the base64 encoding.
No \s-1MIME\s0 decode.
\s-1MIME\s0 encode. Header style. All \s-1ASCII\s0 code and control characters are intact.
\s-1MIME\s0 encode Base64 stream. Kanji conversion is performed before encoding, so this cannot be used as a picture encoder.
Perform quoted encoding.
Input and output code is \s-1ISO8859-1\s0 (Latin-1) and \s-1ISO-2022-JP\s0. -s, -e and -x are not compatible with this option.
Convert line breaks.
unix (\s-1LF\s0)
windows (\s-1CRLF\s0)
mac (\s-1CR\s0) Without this option, nkf doesn't convert line breaks.
Convert for these systems.
Convert to named code.
Assume input system
Set the input or output codeset. \s-1NKF\s0 supports following codesets and those codeset names are case insensitive.
a.k.a. \s-1RFC1468\s0, 7bit \s-1JIS\s0, \s-1JUNET\s0
a.k.a. \s-1AT&T\s0 \s-1JIS\s0, Japanese \s-1EUC\s0, \s-1UJIS\s0
Microsoft Version of EUC-JP.
a.k.a. \s-1SJIS\s0, MS_Kanji
a.k.a. \s-1CP932\s0
same as \s-1UTF-8N\s0
\s-1UTF-8\s0 without \s-1BOM\s0
\s-1UTF-8\s0 with \s-1BOM\s0
decomposed \s-1UTF-8\s0
same as \s-1UTF-16BE\s0
\s-1UTF-16\s0 Big Endian without \s-1BOM\s0
\s-1UTF-16\s0 Big Endian with \s-1BOM\s0
\s-1UTF-16\s0 Little Endian without \s-1BOM\s0
\s-1UTF-16\s0 Little Endian with \s-1BOM\s0
same as \s-1UTF-32BE\s0
\s-1UTF-32\s0 Big Endian without \s-1BOM\s0
\s-1UTF-32\s0 Big Endian with \s-1BOM\s0
\s-1UTF-32\s0 Little Endian without \s-1BOM\s0
\s-1UTF-32\s0 Little Endian with \s-1BOM\s0
Specify the way that nkf handles unassigned characters. Without this option, --fb-skip is assumed.
When nkf converts to Shift_JIS, nkf adds a specified escape character to specified 2nd byte of Shift_JIS characters. 1st byte of argument is the escape character and following bytes are target characters.
Handle the characters extended in \s-1CP932\s0 as unassigned characters.
When Unicode to Encoded byte conversion, don't convert characters which is not round trip safe. When Unicode to Unicode conversion, with this and -x option, nkf can be used as \s-1UTF\s0 converter. (In other words, without this and -x option, nkf doesn't save some characters) When nkf converts strings that related to path, you should use this opion.
Decode hex encoded characters.
Unescape percent escaped characters.
Decode character reference, such as \*(L"....;\*(R".
Overwrite original listed files by filtered result. Note --overwrite preserves timestamps of original files.
Print guessed encoding and newline. (2 is default, 1 is only encoding)
Print nkf's help.
Print nkf's version.
Ignore rest of -option.
Copyright (c) 1987, Fujitsu \s-1LTD\s0. (Itaru \s-1ICHIKAWA\s0).
Copyright (c) 1996-2013, The nkf Project.