Project

General

Profile

Actions

Bug #2290

closed

File.newに与えたエンコーディングは、to_pathで保持されるでしょうか?

Added by takkanm (三村 益隆) over 14 years ago. Updated almost 11 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
Backport:
[ruby-dev:39546]

Description

=begin
ミムラ 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)になります。
=end

Actions #1

Updated by naruse (Yui NARUSE) over 14 years ago

=begin
ファイルシステムエンコーディング (C API で言う rb_filesystem_encoding()) になります。

ちなみに、ファイルシステムエンコーディングを得る Ruby API は現在存在しません。
存在しないのは今まで要望がなかったからです。
=end

Actions #2

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 r25526.
三村, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #3

Updated by naruse (Yui NARUSE) almost 11 years ago

  • Tracker changed from Misc to Bug
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0