From fef3c0a4156b33371e39e05e9616076658d24ad7 Mon Sep 17 00:00:00 2001 From: usa Date: Mon, 17 May 2010 00:41:56 +0000 Subject: [PATCH] * lib/fileutils.rb (FileUtils::Entry_#entries): returns pathname in UTF-8 on Windows to allow FileUtils accessing all pathnames internally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/fileutils.rb | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 72b59ebbb4..eeb87cf3d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Mon May 17 09:37:25 2010 NAKAMURA Usaku + + * lib/fileutils.rb (FileUtils::Entry_#entries): returns pathname in + UTF-8 on Windows to allow FileUtils accessing all pathnames + internally. + Mon May 17 01:07:48 2010 Nobuyoshi Nakada * dln.c (rb_w32_check_imported): workaround for VC6. diff --git a/lib/fileutils.rb b/lib/fileutils.rb index c65f007b8a..f2afdfbcf7 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1176,7 +1176,9 @@ module FileUtils end def entries - Dir.entries(path())\ + opts = {} + opts[:encoding] = "UTF-8" if /mswin|mignw/ =~ RUBY_PLATFORM + Dir.entries(path(), opts)\ .reject {|n| n == '.' or n == '..' }\ .map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) } end