From: "金光雅夫 (KANEMITSU Masao)" Date: 2003-02-04T20:49:35+09:00 Subject: [ruby-list:37052] 改行が認識されない? 金光です。どもっ。 ────────────────────────────────────── #! ruby -Ks require 'nkf' while (line = gets) print NKF.nkf('-m0 -f66 -Ss', line.sub(/\A /s, '%%zwsp%%')).sub(/\A%%zwsp%%/, ' ') print "\n" end ────────────────────────────────────── のようなプログラム(fold)で、getsが一気に全部行を読み込んでいるように なります。ただし、exe版のNKFでも同じ問題が起きています。 require 'Kconv' かな、とも思ったのですが、症状は同じです。 NKFをシフトJisで使うときの注意とかがあるのでしょうか。 M.Kanemitsu ——————————————— 金光雅夫 masao-k@a-net.email.ne.jp http://www.masao-k.net http://isweb14.infoseek.co.jp/art/soshikon/ http://isweb15.infoseek.co.jp/computer/ruby256/ http://www.masao-k.net/tDiary/index.rb http://www.masao-k.net/RubyBook/ 〒216-0031 川崎市宮前区神木本町5-14-12 自宅: 044-877-5006 携帯: 090-2753-5292 -- "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." -Alan Kay