Unicode filenames on Windows in Ruby
问题 I have a piece of code that looks like this: Dir.new(path).each do |entry| puts entry end The problem comes when I have a file named こんにちは世界.txt in the directory that I list. On a Windows 7 machine I get the output: ???????.txt From googling around, properly reading this filename on windows seems to be an impossible task. Any suggestions? 回答1: You're out of luck with pure ruby (either 1.8 or 1.9.1) since it uses the ANSI versions of the Windows API. It seems like Ruby 1.9.2 will support