Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Dir.glob returns UTF-8 string with Windows-31J encoding #4693
jruby 18.104.22.168 (2.3.3) 2017-06-15 33c6439 Java HotSpot(TM) Client VM 24.65-b04 on 1.7.0_65-b19 +jit [mswin32-x86]
Windows 7 Ultimate Service Pack 1 32-bit
I checked the source code for Dir.glob.
Encoding.default_external for Japanese Windows 7 is Windows-31J (aka cp932 or ms932), and this code uses it for multi-byte file name built by Java which is encoded with UTF-8.
Reproduced on Unix by forcing Windows-31J as external encoding:
 ~/projects/jruby $ jruby -EWindows-31J α.rb