RubySpec #2290
File.newに与えたエンコーディングは、to_pathで保持されるでしょうか?
| Status: | Closed | Start date: | 10/27/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 100% |
|
| Category: | M17N | |||
| Target version: | 1.9.2 |
Description
ミムラ 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)になります。
Associated revisions
* encoding.c (get_filesystem_encoding):
add Encoding.filesystem_encoding [ruby-dev:39546]
also see [ruby-core:25959]
* gem_prelude.rb (Gem.set_home):
force_encoding(Encoding.filesystem_encoding)
[ruby-dev:39546]
* gem_prelude.rb (Gem.set_paths): ditto.
History
Updated by Yui NARUSE over 2 years ago
ファイルシステムエンコーディング (C API で言う rb_filesystem_encoding()) になります。 ちなみに、ファイルシステムエンコーディングを得る Ruby API は現在存在しません。 存在しないのは今まで要望がなかったからです。
Updated by Yui NARUSE over 2 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r25526. 三村, thank you for reporting this issue. Your contribution to Ruby is greatly appreciated. May Ruby be with you.