Unicode filenames on windows in ruby

Posted by delivarator on Stack Overflow See other posts from Stack Overflow or by delivarator
Published on 2010-04-24T04:59:40Z Indexed on 2010/04/24 5:03 UTC
Read the original article Hit count: 155

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?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about unicode