From: Austin Ziegler Date: 2006-11-15T00:12:54+09:00 Subject: Re: Ruby on win32 cannot handle certain filenames On 11/13/06, David Barri wrote: > This is my first post in any one the ruby forums :) > > I have a serious ruby windows problem. When I use IO related calls (such > as Dir.glob, File.open, etc) on my machine (WinXP), filenames are always > returned in the shift_jis charset. I've been using iconv to convert to > utf8 but then I came across a much more serious problem: because > File.open is using the shift_jis charset for filenames, it is NOT > POSSIBLE (!) for Ruby to open files that have say European chars in the > filename!! In this day and age SURELY it cannot be the case that it's > not possible in Ruby! It must be my inexperience :) There must be some > way that I don't know about. Any ideas/opinions/suggestions? > > Also, I've tried changing the KCODE but it has absolutely no effect on > Dir.glob or Flie.open. > > Also, when I used Dir.glob, Japanese filenames worked fine but one file > that had an � in it (e with umlat) had been converted somewhere in > ruby's internals to just a plain ASCII e. There must be some way to > disable this internal charset conversion. You're correct. This is a limitation of Ruby as it is currently built. I haven't had time to check whether Matz has m17n Strings in, but this will not be fixable in Ruby 1.8 without using a Unicode string extension and a significant overhaul to the Windows code. -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca