From: Bill Kelly Date: 2010-05-18T19:30:53+09:00 Subject: [ruby-core:30296] Re: [Bug #1685] Some windows unicode path issues remain Hi, Bill Kelly wrote: >> >> 1) matz: the grand designer of Ruby >> 2) naruse: an authority of Ruby M17N >> 3) me: main maintainer of Ruby on Windows >> 4) all users of Ruby, of course, especially people using >> non-unicode (multibyte) environment > > For #4, wouldn't we expect people using a non-unicode environment > to *not* set their default_internal encoding to UTF-8 ? So I > would think they would not be affected. Noticed an interesting ChangeLog entry from yesterday on ruby_1_9_2 branch: Mon May 17 11:09:58 2010 NAKAMURA Usaku merge from trunk (r27856, r27857) * lib/fileutils.rb (FileUtils::Entry_#entries): returns pathname in UTF-8 on Windows to allow FileUtils accessing all pathnames internally. Index: lib/fileutils.rb =================================================================== --- lib/fileutils.rb (revision 27657) +++ lib/fileutils.rb (working copy) @@ -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 =================================================================== Would this approach also be considered for Dir.pwd: result = Dir.pwd(:encoding => "UTF-8") ? If so, I already have the rb_w32_ugetcwd implementation (presented in [ruby-core:30052] ). I would be happy to provide a patch for Dir.pwd if this is acceptable. Regards, Bill