From: Kouhei Yanagita Date: 2010-12-06T23:00:08+09:00 Subject: [ruby-dev:42699] [Ruby 1.9-Bug#4128] String#kconvでfrom_encを指定していないときにString#encodingを使うようになっていない チケット #4128 が更新されました。 (by Kouhei Yanagita) その上の方にも直すべきコメントがありましたのでパッチを送り直します。 Index: ext/nkf/lib/kconv.rb =================================================================== --- ext/nkf/lib/kconv.rb (リビジョン 30091) +++ ext/nkf/lib/kconv.rb (作業コピー) @@ -51,8 +51,8 @@ # call-seq: # Kconv.kconv(str, to_enc, from_enc=nil) # - # Convert str to out_code. - # out_code and in_code are given as constants of Kconv. + # Convert str to to_enc. + # to_enc and from_enc are given as constants of Kconv or Encoding objects. def kconv(str, to_enc, from_enc=nil) opt = '' opt += ' --ic=' + from_enc.to_s if from_enc @@ -199,10 +199,10 @@ # call-seq: # String#kconv(to_enc, from_enc) # - # Convert self to out_code. - # out_code and in_code are given as constants of Kconv. + # Convert self to to_enc. + # to_enc and from_enc are given as constants of Kconv or Encoding objects. def kconv(to_enc, from_enc=nil) - form_enc = self.encoding if !from_enc && self.encoding != Encoding.list[0] + from_enc = self.encoding if !from_enc && self.encoding != Encoding.list[0] Kconv::kconv(self, to_enc, from_enc) end ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4128 ---------------------------------------- http://redmine.ruby-lang.org