Issue #7881 has been updated by usa (Usaku NAKAMURA).


??????????????????Windows??с????????с??????????????絽???locale???expand_path?????????????????????????????????????????吟???????????с????????

???????????????????罕????紊???????????≪?????????????障????????1.9.3???<????c????括????с???????у????????????祉??????????с?????
2.0.0???... ??九???????????????


 C:\> type a.rb
 # coding: utf-8
 unless ''.respond_to?("encoding")
   class String
     def encoding
       "dummy"
     end
   end
 end
 path = File.expand_path("./a")
 p [path, path.encoding]

 C:\> ruby187p371 -v a.rb
 ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mswin32]
 ["C:/a", "dummy"]

 C:\> ruby193p0 -v a.rb
 ruby 1.9.3p0 (2011-10-30 revision 33570) [x64-mswin64_100]
 ["C:/a", #<Encoding:Windows-31J>]

 C:\> ruby193p392 -v a.rb
 ruby 1.9.3p392 (2013-02-22 revision 39386) [x64-mswin64_100]
 ["C:/a", #<Encoding:UTF-8>]

 C:\> ruby200p0 -v a.rb
 ruby 2.0.0p0 (2013-02-24 revision 39474) [x64-mswin64_100]
 ["C:/a", #<Encoding:UTF-8>]

 C:\> cd ???????

 C:\> ruby187p371 -v a.rb
 ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mswin32]
 ["C:/\202\304\202\267\202\306/a", "dummy"]

 C:\> ruby193p0 -v a.rb
 ruby 1.9.3p0 (2011-10-30 revision 33570) [x64-mswin64_100]
 ["C:/???????/a", #<Encoding:Windows-31J>]

 C:\> ruby193p392 -v a.rb
 ruby 1.9.3p392 (2013-02-22 revision 39386) [x64-mswin64_100]
 ["C:/\u3066\u3059\u3068/a", #<Encoding:UTF-8>]

 C:\> ruby200p0 -v a.rb
 ruby 2.0.0p0 (2013-02-24 revision 39474) [x64-mswin64_100]
 ["C:/\u3066\u3059\u3068/a", #<Encoding:UTF-8>]

----------------------------------------
Bug #7881: Windows ??с????鴻??ユ????????????鴻???????????????? require ???紊掩????????
https://bugs.ruby-lang.org/issues/7881#change-37145

Author: 5.5 (5 5)
Status: Assigned
Priority: Normal
Assignee: h.shirosaki (Hiroshi Shirosaki)
Category: core
Target version: next minor
ruby -v: ruby 1.9.3p385 (2013-02-06) [i386-mingw32]


=begin
Windows ??с????鴻??ユ????????????鴻???????????????? require ???紊掩???????障?????

Ruby 1.9.3 ??? p374鐚?p385 ??с????膠???莎激???????障?????鐚?p125 ??с?莎????????障????????
p286 ???????????????莎激???????????????c???????????障?????

???????????????
(1) d:/?????鴻?? ?????????????????若??篏???????
(2) d:/?????鴻??/a.rb ???筝?荐???????????吾????
(3) d:/?????鴻??/b.rb ???筝?荐???????????吾????
(4) cd /?????鴻??
(5) ruby a.rb

a.rb ????絎刻??
 
 # encoding: utf-8
 require "./b"

b.rb ????絎?

 # encoding: utf-8
 puts "No problem."
    
????????э??

cannot load such file -- ./b (LoadError)

?????冴?障?????

* ??????????弱?????????????鴻??????????????test???????????????罩e幻???篏??????障?????
* a.rb ???鴻??????????潟?潟?若????c?潟?違?? CP932 ????????????罩e幻???篏??????障?????
* require "./b" ??? require "./b".encode("CP932") ????????????罩e幻???篏??????障?????
* 罔?羣?羞私?????ゃ??????若?? gem ???泣?ゃ????? require ??с????障?????



=end



-- 
http://bugs.ruby-lang.org/