From: "NARUSE, Yui" Date: 2010-11-02T03:15:40+09:00 Subject: [ruby-dev:42510] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv 成瀬です。 (2010/10/30 21:17), Kouhei Sutou wrote: > チケット #3990 が更新されました。 (by Kouhei Sutou) > This issue was solved with changeset r29646. > > Author: kou > Date: Sat Oct 30 12:10:56 2010 +0000 > > * lib/rexml/encoding.rb: use Ruby native encoding mechnism. [ruby-dev:42464] > * lib/rexml/encodings/: remove. > > * lib/rexml/document.rb, lib/rexml/formatters/default.rb, > lib/rexml/output.rb, lib/rexml/parseexception.rb, > lib/rexml/parsers/baseparser.rb, lib/rexml/source.rb, > lib/rexml/xmldecl.rb: use Ruby's native Encoding object. > > * test/rexml/, test/rss/: follow the above encoding chagnes. > > * NEWS: add REXML's incompatible change about encoding. この変更では、Ruby M17N の encoding system を使うようにしていますが、 導入した非互換変更には反対です。 総論として、REXML は Ruby 的に非推奨という扱いになりつつあるというのは 合意がとれていると思われるところ、この状況下で非互換変更をするのは 避けるべきだと思います。 また、今回の REXML::Document#encoding, REXML::XMLdecl#encoding, REXML::Output#encoding and REXML::Source#encoding は、 ドキュメントが自称しているエンコーディングと、Ruby が解釈し使っている エンコーディングは分離するべきでしょう。 直近では UTF-16BE/UTF-16LE は BOM なしを意味するので、 BOM 付きの UTF-16 が欲しいときに困ります。 (なお、UTF-16 は ASCII incompatible なので色々バグってる気がする) というわけで、encoding メソッドは以前のままにして、Encoding オブジェクトを 返すメソッドを新設した方がよいのではないかと思います。 -- NARUSE, Yui