Actions
Bug #4128
closedString#kconvでfrom_encを指定していないときにString#encodingを使うようになっていない
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-12-06 trunk 30091) [i686-linux]
Backport:
Description
=begin
typoがあり、意図した通りの動作になっていません。
あと、コメントが古かったので修正してみました。
Index: ext/nkf/lib/kconv.rb¶
--- ext/nkf/lib/kconv.rb (リビジョン 30091)
+++ ext/nkf/lib/kconv.rb (作業コピー)
@@ -200,9 +200,9 @@
# String#kconv(to_enc, from_enc)
#
# Convert self
to out_code.
-
out_code
andin_code
are given as constants of Kconv.¶
-
to_enc
andfrom_enc
are given as constants of Kconv or Encoding objects.¶
- 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
=end
Updated by kyanagi (Kouhei Yanagita) over 14 years ago
=begin
その上の方にも直すべきコメントがありましたのでパッチを送り直します。
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
toto_enc
.¶ -
to_enc
andfrom_enc
are given as constants of Kconv or Encoding objects.¶
opt = ''
opt += ' --ic=' + from_enc.to_s if from_enc
@@ -199,10 +199,10 @@call-seq:¶
String#kconv(to_enc, from_enc)¶
-
Convert
self
toto_enc
.¶ -
to_enc
andfrom_enc
are given as constants of Kconv or Encoding objects.¶
- 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
=end
Updated by naruse (Yui NARUSE) over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r30112.
Kouhei, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Actions
Like0
Like0Like0