From: Bill Kelly Date: 2009-07-09T03:29:13+09:00 Subject: Re: Ruby 1.8 - character encoding From: "Bill Kelly" > From: "Thomas Thomassen" >> Andd, I also don't know what would happen for an eastern user. I'm >> wondering if the IO functions would assume a different 8bit encoding... > > For best 8-bit compatibility you'll want to encode to Windows1252. Hmm, I take it back; even for 8-bit it appears slightly more complicated on windows... Apparently depending on AreFileApisANSI() one would encode to GetACP() vs. GetOEMCP() Ruby 1.9.1 is smart enough to handle this automatically (see: rb_filesystem_encoding() in encoding.c) But anyway this is all still referring to 8-bit code pages and still won't help for chinese (etc.) characters anyway... * * * So, again, if you absolutely need to handle unicode paths on windows prior to ruby 1.9.2, and you don't have the option of writing your own ruby C extension, the I think trying to call wide-character functions like _wopen() via ruby's Win32API module may be the only option. :( Regards, Bill