From: Daniel Berger Date: 2007-06-07T10:05:13+09:00 Subject: Re: Patching win32 ruby fopen/opendir/stat/rename/unlink to work with UTF8 paths? Bill Kelly wrote: > Hi, > > I'm using ruby in a Unicode-aware cross-platform application. > We use UTF8, and on OS X unicode paths and filenames "just work", > because the underlying fopen(), etc. calls understand UTF8. > > Of course, things are not so nice on Windows. > > I'm considering patching the stdlib calls used by ruby to use > UTF8 behind-the-scenes on Windows. > > Either by #define fopen(name, mode) utf8_fopen(name, mode) > > Or by just changing ruby's use of fopen to utf8_fopen. (And > then make utf8_fopen simply defined back to fopen on non- > Windows systems.) You can look here for how to implement it in Windows. I have no idea what platforms support utf8_fopen and which don't. http://www.koders.com/c/fid7D9DF187D3F371F71F7D6B1779A4EF93316425B9.aspx > What I'm wondering is, > > 1. Has anyone already tried this? It seems to be it should > be pretty straightforward. Can anyone think of a reason why it might > not be easy? Cross platform issues will be the number 1 issue I imagine. But, it's certainly possible. > 2. Would anyone here be interested in such a patch? I'm asking > because I'd like to make the changes in the most harmonious way > possible. For example, would the #define fopen approach above be > preferred? Or changing fopen to utf8_fopen? I vote that you write it and submit it. It may or may not be accepted, but you can at least try. :) Regards, Dan