11件ヒット
[1-11件を表示]
(0.046秒)
ライブラリ
- nkf (11)
検索結果
先頭1件
-
NKF (817.0)
-
nkf(Network Kanji code conversion Filter, https://osdn.net/projects/nkf/) を Ruby から使うためのモジュールです。
...字コード変換コマンドの例です。
//emlist[例][ruby]{
#!/usr/local/bin/ruby
require 'nkf'
opt = ''
opt = ARGV.shift if ARGV[0][0] == ?-
while line = ARGF.gets
print NKF.nkf(opt, line)
end
//}
以下は、漢字コード判別コマンドの例です。
//emlist[例][ruby]{
#!/us......nil) }
printf "%-10s ", file
if str.nil?
puts "EMPTY"
else
puts CODES.fetch(NKF.guess(str))
end
end
//}
=== オプション文字列
-b 入力がバッファリングされる(デフォルト)
-u 入力がバッファリングされない
-j -s -e -w -w16 出力するエ......
-j ISO-2022-JP (7bit JIS) を出力する(デフォルト)
-s Shift_JIS を出力する
-e EUC-JP を出力する
-w UTF-8 を出力する(BOMなし)
-w16 UTF-16 LE を出力する
-J -S -E -W -W16 入力文字列のエンコーディングの推定値を指定する。
-J...