
Den 31-01-2012 00:06, Ion Gaztañaga skrev:
El 30/01/2012 14:36, Thorsten Ottosen escribió:
It would be great if we could support utf8 encoded file names on windows too.
I guess all it requires is a utility function that converts from utf8 to utf16 on windows. Such a function is avaiable in the windows API, and I can supply it.
No, I need to change all internals and windows api to use wide strings instead of narrow ones. I guess I could use boost::filesystem::path or similar instead of raw strings (after all, named objects use something similar to paths), but I also need to be backwards compatible and write some maintainable code, supporting also wide strings in Unix platforms. Suggestions welcome.
Lately I have been porting our 32 bit windows apps to 64 bit linux. The single most time consuming (and annoying) problem has been in dealing with portable file names. I don't see any particular reason for supporting wide strings, neither in Boost.Filesystem or Interprocess. If everything was in "utf8-mode", we can just use std:::string. Of course, both libraries needs to do custom stuff under the hood (e.g. converting to utf16 on windows before calling the windows api). -Thorsten