From: "益隆 三村" Date: 2009-10-27T20:48:03+09:00 Subject: [ruby-dev:39546] [RubySpec #2290] File.newに与えたエンコーディングは、to_pathで保持されるでしょうか? RubySpec #2290: File.newに与えたエンコーディングは、to_pathで保持されるでしょうか? http://redmine.ruby-lang.org/issues/show/2290 起票者: 益隆 三村 ステータス: Open, 優先度: Normal カテゴリ: M17N, Target version: 1.9.2 ミムラ aka takkanm です。 asakusa.rbでrubyspecを実施中で気になったものがあります。 core/file/to_path_spec.rb 28 it "preserves the encoding of the path" do 29 path = File.new(__FILE__.encode('euc-jp')).to_path 30 path.encoding.should == Encoding::EUC_JP 31 end このスペックが私の環境(leopard)だとEncoding:UTF-8となります。 File.newに与えたエンコーディングは、to_pathで保持されず、 環境依存となるのでしょうか? 実施したrubyのバージョンは、 1.9.2dev (2009-10-27 trunk 25511)になります。 ---------------------------------------- http://redmine.ruby-lang.org