Heesob Park wrote:
> 2008/8/24 SpringFlowers AutumnMoon <summercoolness / gmail.com>:
>>
>>
>> }
> As a quick workaround, try this:
> 
> 
> require 'Win32API'
> FILE_ATTRIBUTE_DIRECTORY = 0x10
> MoveFileW = Win32API.new('kernel32','MoveFileW','PP','I')
> GetFileAttributesW = 
> Win32API.new('kernel32','GetFileAttributesW','P','L')
>
>  [...]

Wow, it really works!  You rock, Park!  Looks like one key line here is 
the `cmd /u /c dir /b`, which is to get the filenames in unicode 
characters.

After that, I tried

  p "good" if File.file?(file)

in Ruby 1.8.6 and 1.9 and they both gave error that the filename 
contains null character.

Hm, I wonder for people who use Ruby on Japanese Windows XP/Vista, or 
European version of Windows, how do they deal with getting filenames 
that has non-English characters?

Do we want to have a small speed competition and see which country can 
provide the first solution using fairly standard Ruby?  (without 
resorting to win32api)?

Thanks a lot, Park!
-- 
Posted via http://www.ruby-forum.com/.