NKF(1)

NAME
nkf - Network Kanji code conversion Filter v1.6.2

SYNOPSIS
nkf [-blrtTuvxXZ] [-ejs] [-BEJS] [-m [BQ]] [-f n] [-io c]

DESCRIPTION
Nkf is yet another kanji encoding converter between networks, hosts and terminals. It converts any input kanji encoding to a designated kanji encoding, such as 7-bit JIS, MS-kanji (shifted-JIS) or EUC.

One of the most unique features of nkf is the guess of the input kanji encoding. It currently recognizes 7-bit JIS, MS-kanji (shifted-JIS) and EUC automatically, so users don't need to know the kanji encoding used for input. By default X0201 kana is converted into X0208 kana. For X0201 kana, SO/SI, SSO and ESC-(-I methods are supported. For automatic encoding detection, nkf assumes no X0201 kana in MS-Kanji. To accept X0201 in MS-Kanji, use -X, -x or -S.

The following options are available:

-b  buffered output (default).

-u  unbuffered output.

-t  no operation.

-j  output 7-bit JIS code (default).

-s  output MS-kanji (shifted-JIS) code.

-e  output EUC (AT&T) code.

-i c
    output an ESC $ c sequence to designate JIS-kanji (Default is B).

-o c
    output an ESC ( c sequence to designate single-byte roman characters (Default is B).

-r  {de/en}crypt ROT13/47.

-v  display Version.

-T  Text mode output (MS-DOS).

-m  MIME ISO-2022-JP/ISO8859-1 decoding. To see ISO8859-1 (Latin-1) -l is necessary.

-m B
    Decode MIME base64 encoded stream. Remove header or other parts before conversion.

-m Q
    Decode MIME quoted stream. '_' inside quotes is converted to space.

-l  Input and output code is ISO8859-1 (Latin-1) and ISO-2022-JP. -s, -e -and -x are not compatible with this option.

-f n
    Folding on length n in a line (default 60).

-X  Allow X0201 kana in MS-Kanji. X0201 is converted into X0208 by default.

-x  Try to preseve X0208 kana. Assume X0201 kana in MS-Kanji. And do not convert X0201 kana to X0208. In JIS output, ESC-(-I is used. In EUC output, SSO is used.

-Z  Convert X0208 alphabet to ASCII.

-S  Assume MS-Kanji and X0201 kana input. It also accepts JIS. AT&T EUC is recognized as X0201 kana. Without the -x flag, X0201 kana is converted into X0208.

-J  Assume JIS input. It also accepts Japanese EUC. This is the default. This flag does not exclude MS-Kanji.

-E  Assume AT&T EUC input. It also accept JIS. Same as -J, present for symetry.

-B  Assume broken JIS-Kanji, where ESC has been lost. Useful when your site is using old B-News Nihongo patch.

AUTHOR
Itaru Ichikawa <ichikawa@flab.fujitsu.co.jp>

EDITOR
a_kuroe@hoffman.cc.sophia.ac.jp (Akihiko Kuroe)

kono@ie.u-ryukyu.ac.jp (Shinji KONO)

SEE ALSO
by Ken Lunde (O'Reilly associates) for a comprehensive description of japanese text encoding systems.

BUGS
Nkf cannot handle some inputs that contain mixed kanji encoding.

Automatic code detection becomes very weak with -x, -X and -S.