スポンサーリンク

nkfは、Network Kanji
Filter
の略で、ネットワーク用漢字コード変換フィルタのことです。
nkfの特徴は、入力漢字コード系の統計的な自動認識機能です。
ユーザは、入力する漢字コードを意識することなく、目的の文字コードに変換することができます。

今回は、CentOSyumコマンドを用いて、nkfコマンドをインストールしてみます。

薫@c1$ sudo yum install nkf
Password:
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
base                      100% |=========================| 1.1 kB    00:00
updates                   100% |=========================|  951 B    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 352 kB    00:00
updates   : ################################################## 764/764
Added 206 new packages, deleted 0 old in 9.33 seconds
primary.xml.gz            100% |=========================|  77 kB    00:00
extras    : ################################################## 302/302
Added 66 new packages, deleted 2 old in 2.37 seconds
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for nkf to pack into transaction set.
nkf-2.07-1.1.fc6.i386.rpm 100% |=========================| 5.2 kB    00:00
---> Package nkf.i386 0:2.07-1.1.fc6 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 nkf                     i386       2.07-1.1.fc6     base              111 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 111 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): nkf-2.07-1.1.fc6.i 100% |=========================| 111 kB    00:04
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: nkf                          ######################### [1/1]

Installed: nkf.i386 0:2.07-1.1.fc6
Complete!

薫@c1$ nkf -v
USAGE:  nkf(nkf32,wnkf,nkf2) -[flags] [in file] .. [out file for -O flag]
Flags:
b,u      Output is buffered (DEFAULT),Output is unbuffered
j,s,e,w  Outout code is JIS 7 bit (DEFAULT), Shift JIS, EUC-JP, UTF-8N
         After 'w' you can add more options. -w[ 8 [0], 16 [[BL] [0]] ]
J,S,E,W  Input assumption is JIS 7 bit , Shift JIS, EUC-JP, UTF-8
         After 'W' you can add more options. -W[ 8, 16 [BL] ]
t        no conversion
i[@B]    Specify the Esc Seq for JIS X 0208-1978/83 (DEFAULT B)
o[BJH]   Specify the Esc Seq for ASCII/Roman        (DEFAULT B)
r        {de/en}crypt ROT13/47
h        1 katakana->hiragana, 2 hiragana->katakana, 3 both
v        Show this usage. V: show version
m[BQN0]  MIME decode [B:base64,Q:quoted,N:non-strict,0:no decode]
M[BQ]    MIME encode [B:base64 Q:quoted]
l        ISO8859-1 (Latin-1) support
f/F      Folding: -f60 or -f or -f60-10 (fold margin 10) F preserve nl
Z[0-3]   Convert X0208 alphabet to ASCII
         1: Kankaku to 1 space  2: to 2 spaces  3: Convert to HTML Entity
X,x      Assume X0201 kana in MS-Kanji, -x preserves X0201
B[0-2]   Broken input  0: missing ESC,1: any X on ESC-[($]-X,2: ASCII on NL
O        Output to File (DEFAULT 'nkf.out')
I        Convert non ISO-2022-JP charactor to GETA
d,c      Convert line breaks  -d: LF  -c: CRLF
-L[uwm]  line mode u:LF w:CRLF m:CR (DEFAULT noconversion)

Long name options
 --ic=<input codeset>  --oc=<output codeset>
                   Specify the input or output codeset
 --fj  --unix --mac  --windows
 --jis  --euc  --sjis  --utf8  --utf16  --mime  --base64
                   Convert for the system or code
 --hiragana  --katakana  --katakana-hiragana
                   To Hiragana/Katakana Conversion
 --prefix=         Insert escape before troublesome characters of Shift_JIS
 --cap-input, --url-input  Convert hex after ':' or '%'
 --numchar-input   Convert Unicode Character Reference
 --fb-{skip, html, xml, perl, java, subchar}
                   Specify how nkf handles unassigned characters
 --in-place[=SUFFIX]  --overwrite[=SUFFIX]
                   Overwrite original listed files by filtered result
                   --overwrite preserves timestamp of original files
 -g  --guess       Guess the input code
 --help  --version Show this help/the version
                   For more information, see also man nkf

Network Kanji Filter Version 2.0.7 (2006-06-13)
Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW
Copyright (C) 2002-2006 Kono, Furukawa, Naruse, mastodon

CentOSでは、/usr/bin に
nkfコマンドがインストールされました。

薫@c1$ which nkf
/usr/bin/nkf
薫@c1$ nkf -g /etc/fstab
ASCII
参照しているページ (サイト内): [2008-08-17-2] [2008-08-17-1] [2008-08-16-2] [2008-08-14-2] [2008-07-30-1]

スポンサーリンク
スポンサーリンク
 
いつもシェア、ありがとうございます!


もっと情報を探しませんか?

関連記事

最近の記事

人気のページ

スポンサーリンク
 

過去ログ

2020 : 01 02 03 04 05 06 07 08 09 10 11 12
2019 : 01 02 03 04 05 06 07 08 09 10 11 12
2018 : 01 02 03 04 05 06 07 08 09 10 11 12
2017 : 01 02 03 04 05 06 07 08 09 10 11 12
2016 : 01 02 03 04 05 06 07 08 09 10 11 12
2015 : 01 02 03 04 05 06 07 08 09 10 11 12
2014 : 01 02 03 04 05 06 07 08 09 10 11 12
2013 : 01 02 03 04 05 06 07 08 09 10 11 12
2012 : 01 02 03 04 05 06 07 08 09 10 11 12
2011 : 01 02 03 04 05 06 07 08 09 10 11 12
2010 : 01 02 03 04 05 06 07 08 09 10 11 12
2009 : 01 02 03 04 05 06 07 08 09 10 11 12
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
2004 : 01 02 03 04 05 06 07 08 09 10 11 12
2003 : 01 02 03 04 05 06 07 08 09 10 11 12

サイト

Vim入門

C言語入門

C++入門

JavaScript/Node.js入門

Python入門

FreeBSD入門

Ubuntu入門

セキュリティ入門

パソコン自作入門

ブログ

トップ


プライバシーポリシー