[前][次][番号順一覧][スレッド一覧]

ruby-changes:15915

From: usa <ko1@a...>
Date: Mon, 17 May 2010 09:42:13 +0900 (JST)
Subject: [ruby-changes:15915] Ruby:r27856 (trunk): * lib/fileutils.rb (FileUtils::Entry_#entries): returns pathname in

usa	2010-05-17 09:41:56 +0900 (Mon, 17 May 2010)

  New Revision: 27856

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27856

  Log:
    * lib/fileutils.rb (FileUtils::Entry_#entries): returns pathname in
      UTF-8 on Windows to allow FileUtils accessing all pathnames
      internally.

  Modified files:
    trunk/ChangeLog
    trunk/lib/fileutils.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27855)
+++ ChangeLog	(revision 27856)
@@ -1,3 +1,9 @@
+Mon May 17 09:37:25 2010  NAKAMURA Usaku  <usa@r...>
+
+	* 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  <nobu@r...>
 
 	* dln.c (rb_w32_check_imported): workaround for VC6.
Index: lib/fileutils.rb
===================================================================
--- lib/fileutils.rb	(revision 27855)
+++ lib/fileutils.rb	(revision 27856)
@@ -1176,7 +1176,9 @@
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]