From: Nobuyoshi Nakada Date: 2006-11-15T01:44:11+09:00 Subject: Re: Ruby on win32 cannot handle certain filenames Hi, At Tue, 14 Nov 2006 09:28:58 +0900, David Barri wrote in [ruby-talk:224879]: > 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. Do you use Japanese version Windows? Those methods use "OEM string" but have no shift_jis specific code. > 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? If your system runs with European 8-bit charset, it should work by setting $KCODE to "N". > Also, I've tried changing the KCODE but it has absolutely no effect on > Dir.glob or Flie.open. $KCODE is for internal use, typically Regexp. > 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. Not ruby's internals, it's done in Windows kernel. -- Nobu Nakada