I'm working on a project that does a substantial amount of pathname manipulation. It runs fine on Mac OS X but to my astonishment, there's no way to call functions like realpath with utf-8 encoded strings on Windows. This is because setlocale on Windows doesn't support utf-8:
http://msdn.microsoft.com/en-us/library/x99tb11d.aspx
http://www.phpwact.org/php/i18n/utf-8
I can make wrapper functions that call utf8_encode and utf8_decode internally, but there are so many file functions in php that this places quite a burden on me.
Also the project is open source so users may perceive it as breaking when they try to use my strings (which are all utf-8 as to be web-oriented) in their own code to read/write files.
Is there a library that provides utf-8 versions of the major php file functions? I'd prefer a self-contained directory over an extension so that I can bundle it with my code.
I'm concerned that if I can't find a library like this, it may be the achilles heal that makes php unsuitable for cross platform development for me. I'm also curious how other languages like ruby, python and c++ get around this issue, if they do at all. If not, this may just be another strike against Windows and I will have to figure out another workaround.